Creates an upload session

 @param project_id ID of the Project
 @param video_upload_body
 @param [Hash] opts the optional parameters
 @return [UploadSession]
557899
def upload_video(project_id, video_upload_body, opts = {})
      data, _status_code, _headers = upload_video_with_http_info(project_id, video_upload_body, opts)
      return data
    end
1033413
def project(project_id, opts = {})
      data, _status_code, _headers = project_with_http_info(project_id, opts)
      return data
    end
1249210
def createfork(self, project_id):
        

        request = requests.post(
            '{0}/fork/{1}'.format(self.projects_url, project_id),
            timeout=self.timeout, verify=self.verify_ssl)

        if request.status_code == 200:
            return True
        else:
            return False
691563
def create_project(self, name, body=github.GithubObject.NotSet):
        
        assert isinstance(name, (str, unicode)), name
        assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body
        post_parameters = {
            "name": name,
            "body": body,
        }
        import_header = {"Accept": Consts.mediaTypeProjectsPreview}
        if body is not github.GithubObject.NotSet:
            post_parameters['body'] = body
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            self.url + "/projects",
            headers=import_header,
            input=post_parameters
        )
        return github.Project.Project(self._requester, headers, data, completed=True)
1295503
def append_upload_session(cursor, body, close=false)
      args = {cursor: cursor.to_h, close: close}
      resp = upload_request('/files/upload_session/append_v2', body, args)
      cursor.offset += body.length
      cursor
    end
1204219
def get_stream_url(self, session_id, stream_id=None):
        
        url = self.api_url + '/v2/project/' + self.api_key + '/session/' + session_id + '/stream'
        if stream_id:
            url = url + '/' + stream_id
        return url
1019865
public static function upload_data($userid,$file_data,$session,$offset){
		$expired = time() + self::EXPIRED_SECONDS;
		$url = self::generateResUrl($userid);
		$sign = Auth::appSign($url, $expired);

		$data = array(
            'FileContent' => $file_data,
			'op' => 'upload_slice',
			'session' => $session,
			'offset' => $offset,
        );

        $req = array(
            'url' => $url,
            'method' => 'post',
            'timeout' => 10,
            'data' => $data,
            'header' => array(
                'Authorization:'.$sign,
            ),
        );

		$rsp = Http::send($req);
		$info = Http::info();
		$ret = json_decode($rsp, true);
		if ($ret) {
			if (0 === $ret['code']) {
				$ret['httpcode'] = $info['http_code'];
				return $ret;
			} else {
				return array(
					'httpcode' => $info['http_code'],
					'code' => $ret['code'],
					'message' => $ret['message'],
					'data' => array()
				);
			}
		} else {
			return array(
					'httpcode' => $info['http_code'],
					'code' => self::VIDEO_NETWORK_ERROR,
					'message' => 'network error', 'data' => array()
				);
		}
	}
32471
def upload(path, body, options={})
      options[:client_modified] = Time.now.utc.iso8601
      options[:path] = path
      resp = upload_request('/files/upload', body, options.merge(path: path))
      FileMetadata.new(resp)
    end
1091490
def video_with_http_info(id, factory_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: FlipApi.video ..."
      end
      # verify the required parameter 'id' is set
      if @api_client.config.client_side_validation && id.nil?
        fail ArgumentError, "Missing the required parameter 'id' when calling FlipApi.video"
      end
      # verify the required parameter 'factory_id' is set
      if @api_client.config.client_side_validation && factory_id.nil?
        fail ArgumentError, "Missing the required parameter 'factory_id' when calling FlipApi.video"
      end
      # resource path
      local_var_path = "/videos/{id}.json".sub('{' + 'id' + '}', id.to_s)

      # query parameters
      query_params = {}
      query_params[:'factory_id'] = factory_id

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['api_key']
      data, status_code, headers = @api_client.call_api(:GET, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'Video')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: FlipApi#video\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
419785
public BoxRequestsFile.UploadSessionPart getUploadSessionPartRequest(File file, BoxUploadSession uploadSession,
                                                                         int partNumber) throws IOException {
        return new BoxRequestsFile.UploadSessionPart(file, uploadSession, partNumber, mSession);
    }
783137
def create_single_poll_session(self, poll_id, poll_sessions_course_id, poll_sessions_course_section_id=None, poll_sessions_has_public_results=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - poll_id
        """ID"""
        path["poll_id"] = poll_id

        # REQUIRED - poll_sessions[course_id]
        """The id of the course this session is associated with."""
        data["poll_sessions[course_id]"] = poll_sessions_course_id

        # OPTIONAL - poll_sessions[course_section_id]
        """The id of the course section this session is associated with."""
        if poll_sessions_course_section_id is not None:
            data["poll_sessions[course_section_id]"] = poll_sessions_course_section_id

        # OPTIONAL - poll_sessions[has_public_results]
        """Whether or not results are viewable by students."""
        if poll_sessions_has_public_results is not None:
            data["poll_sessions[has_public_results]"] = poll_sessions_has_public_results

        self.logger.debug("POST /api/v1/polls/{poll_id}/poll_sessions with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/polls/{poll_id}/poll_sessions".format(**path), data=data, params=params, no_data=True)
931611
def create(username, groups = '', opts = {})
      payload = {
        :account => {
          :username => username,
          :comment  => '',
          :groups   => groups,
          :password => password_opts.merge(opts.fetch(:password, {}))
        }
      }
      @server.commands.get(post(payload)['command']['id'])
    end
472859
async def create_session(self, **kwargs):
        
        self.opts.update(kwargs)
        self._session = aiohttp.ClientSession(**self.opts, loop=self._loop)
        if self.redis_opts:
            if aioredis:
                self._redis = await aioredis.create_redis(**self.redis_opts,
                                                          loop=self._loop)
            else:
                warnings.warn(no_redis_warning)
37356
def post(uri, body, opts = {}, &block)
      initialize_socket(uri, opts)
      HttpStream::post(uri, body, opts, &block)
    rescue IOError => e
      raise e unless @intentional_termination
    end
371177
public BoxRequestsFile.GetUploadSession getUploadSession(String uploadSessionId) {
        return new BoxRequestsFile.GetUploadSession(uploadSessionId, getUploadSessionInfoUrl(uploadSessionId), mSession);
    }
677352
def create(self, project_id=None):
    
    if not self.exists():
      if project_id is None:
        project_id = self._api.project_id
      try:
        self._info = self._api.buckets_insert(self._name, project_id=project_id)
      except Exception as e:
        raise e
    return self
1158754
function (project_id, copy_options, cb) {

            _util.buildQuery('projects/' + project_id + '/copy', copy_options, function (error, data) {

                return cb(error, data);

            });

        }