def get_milestone(number=None, name=None, repo_name=None, profile='github', output='min'):
 ret = {}
 if (not any([number, name])):
  raise CommandExecutionError("Either a milestone 'name' or 'number' must be provided.")
 org_name = _get_config_value(profile, 'org_name')
 if (repo_name is None):
  repo_name = _get_config_value(profile, 'repo_name')
 action = '/'.join(['repos', org_name, repo_name])
 if number:
  command = ('milestones/' + str(number))
  milestone_data = _query(profile, action=action, command=command)
  milestone_id = milestone_data.get('id')
  if (output == 'full'):
   ret[milestone_id] = milestone_data
  else:
   milestone_data.pop('creator')
   milestone_data.pop('html_url')
   milestone_data.pop('labels_url')
   ret[milestone_id] = milestone_data
  return ret
 else:
  milestones = get_milestones(repo_name=repo_name, profile=profile, output=output)
  for (key, val) in six.iteritems(milestones):
   if (val.get('title') == name):
    ret[key] = val
    return ret
 return ret

def get_milestone ( number = None , name = None , repo_name = None , profile = 'github' , output = 'min' ) : ret = { } if ( not any ( [ number , name ] ) ) : raise CommandExecutionError ( "Either a milestone 'name' or 'number' must be provided." ) org_name = _get_config_value ( profile , 'org_name' ) if ( repo_name is None ) : repo_name = _get_config_value ( profile , 'repo_name' ) action = '/' . join ( [ 'repos' , org_name , repo_name ] ) if number : command = ( 'milestones/' + str ( number ) ) milestone_data = _query ( profile , action = action , command = command ) milestone_id = milestone_data . get ( 'id' ) if ( output == 'full' ) : ret [ milestone_id ] = milestone_data else : milestone_data . pop ( 'creator' ) milestone_data . pop ( 'html_url' ) milestone_data . pop ( 'labels_url' ) ret [ milestone_id ] = milestone_data return ret else : milestones = get_milestones ( repo_name = repo_name , profile = profile , output = output ) for ( key , val ) in six . iteritems ( milestones ) : if ( val . get ( 'title' ) == name ) : ret [ key ] = val return ret return ret
return information about a single milestone in a named repository .