Handles request for listing accounts
174780
@RequestMapping(value = "/listGedikStocks", method = RequestMethod.GET)
	public @ResponseBody
	ResponseGedikStockList listGedikStocks(
			HttpServletResponse response) {
		logger.debug("Received request to list gedik stocks");
		
		ResponseGedikStockList gedikStockList = null;
		try {
			gedikStockList = gedikStockService.getAllStocks();
		} catch (IOException e) {
			logger.error(e.getMessage());
			e.printStackTrace();
		}
		return gedikStockList;

	}
1019041
def _populate_common_request(self, request):
        ''''''
        url_record = self._item_session.url_record

        # Note that referrer may have already been set by the --referer option
        if url_record.parent_url and not request.fields.get('Referer'):
            self._add_referrer(request, url_record)

        if self._fetch_rule.http_login:
            request.username, request.password = self._fetch_rule.http_login
490174
def query_orders(self, accounts, status='filled'):
        
        try:
            data = self.call("orders", {'client': accounts, 'status': status})

            if data is not None:
                orders = data.get('dataTable', False)

                order_headers = orders['columns']
                if ('成交状态' in order_headers
                        or '状态说明' in order_headers) and ('备注' in order_headers):
                    order_headers[order_headers.index('备注')] = '废弃'

                order_headers = [cn_en_compare[item] for item in order_headers]
                order_all = pd.DataFrame(
                    orders['rows'],
                    columns=order_headers
                ).assign(account_cookie=accounts)

                order_all.towards = order_all.towards.apply(
                    lambda x: trade_towards_cn_en[x]
                )
                if 'order_time' in order_headers:
                    # 这是order_status
                    order_all['status'] = order_all.status.apply(
                        lambda x: order_status_cn_en[x]
                    )
                    if 'order_date' not in order_headers:
                        order_all.order_time = order_all.order_time.apply(
                            lambda x: QA_util_get_order_datetime(
                                dt='{} {}'.format(datetime.date.today(),
                                                  x)
                            )
                        )
                    else:
                        order_all = order_all.assign(
                            order_time=order_all.order_date
                            .apply(QA_util_date_int2str) + ' ' +
                            order_all.order_time
                        )

                if 'trade_time' in order_headers:

                    order_all.trade_time = order_all.trade_time.apply(
                        lambda x: '{} {}'.format(datetime.date.today(),
                                                 x)
                    )

                if status is 'filled':
                    return order_all.loc[:,
                                         self.dealstatus_headers].set_index(
                                             ['account_cookie',
                                              'realorder_id']
                    ).sort_index()
                else:
                    return order_all.loc[:,
                                         self.orderstatus_headers].set_index(
                                             ['account_cookie',
                                              'realorder_id']
                    ).sort_index()
            else:
                print('response is None')
                return False
        except Exception as e:
            print(e)
            return False
1193731
def index(request, obj_id):
    """"""
    if request.method == 'GET':
        return get(request, obj_id)
    elif request.method == 'PUT':
        getPutData(request)
        return put(request, obj_id)
604046
function Listings (options) {
    options = options || {};

    EventEmitter.call(this);

    this.accessToken = options.accessToken;
    this.steamid64 = options.steamid64;

    this.waitTime = options.waitTime || 1000;

    this.cap = -1;
    this.promotes = -1;
    this.listings = [];

    this.actions = {
        create: [],
        remove: []
    };

    this.items = options.items || new Items({ apiKey: options.apiKey });

    this.ready = false;
}
1182411
def list_orders(self, params=None):
        """"""
        request = self._get('transactions/orders', params)
        return self.responder(request)
411648
@CacheControl(policy = { CachePolicy.PRIVATE, CachePolicy.MUST_REVALIDATE }) 
	@RequestMapping("/account.do")
	public String handleAccountRequest(Model model) {
		model.addAttribute("pageName", "Your Account");
		return "page";
	}
724634
def request(order_Id,amount,billing_cust_name,billing_cust_address,billing_cust_city,billing_zip_code,billing_cust_state,billing_cust_country,billing_cust_email,billing_cust_tel,billing_cust_notes="",delivery_cust_name="",delivery_cust_address="",delivery_cust_city="",delivery_zip_code="",delivery_cust_state="",delivery_cust_country="",delivery_cust_email="",delivery_cust_tel="",delivery_cust_notes="")
  		checksum = getChecksum(order_Id,amount)
  		raw_request = "Merchant_Id=#{@merchant_Id}&Amount=#{amount}&Order_Id=#{order_Id}&Redirect_Url=#{@redirect_Url}&billing_cust_name=#{billing_cust_name}&billing_cust_address=#{billing_cust_address}&billing_cust_country=#{billing_cust_country}&billing_cust_state=#{billing_cust_state}&billing_cust_city=#{billing_cust_city}&billing_zip_code=#{billing_zip_code}&billing_cust_tel=#{billing_cust_tel}&billing_cust_email=#{billing_cust_email}&billing_cust_notes=#{billing_cust_notes}&delivery_cust_name=#{delivery_cust_name}&delivery_cust_address=#{delivery_cust_address}&delivery_cust_country=#{delivery_cust_country}&delivery_cust_state=#{delivery_cust_state}&delivery_cust_city=#{delivery_cust_city}&delivery_zip_code=#{delivery_zip_code}&delivery_cust_tel=#{delivery_cust_tel}&billing_cust_notes=#{delivery_cust_notes}&Checksum=#{checksum.to_s}"
  		return encrypt_data(raw_request,@working_Key,"AES-128-CBC")[0]
  	end
982119
def handle_delete_account(self, req):
        
        if not self.is_reseller_admin(req):
            return self.denied_response(req)
        account = req.path_info_pop()
        if req.path_info or not account or account[0] == '.':
            return HTTPBadRequest(request=req)
        # Make sure the account has no users and get the account_id
        marker = ''
        while True:
            path = '/v1/%s?format=json&marker=%s' % (quote('%s/%s' %
                (self.auth_account, account)), quote(marker))
            resp = self.make_pre_authed_request(
                req.environ, 'GET', path).get_response(self.app)
            if resp.status_int == 404:
                return HTTPNotFound(request=req)
            if resp.status_int // 100 != 2:
                raise Exception('Could not list in main auth account: %s %s' %
                                (path, resp.status))
            account_id = resp.headers['x-container-meta-account-id']
            sublisting = json.loads(resp.body)
            if not sublisting:
                break
            for obj in sublisting:
                if obj['name'][0] != '.':
                    return HTTPConflict(request=req)
            marker = sublisting[-1]['name'].encode('utf-8')
        # Obtain the listing of services the account is on.
        path = quote('/v1/%s/%s/.services' % (self.auth_account, account))
        resp = self.make_pre_authed_request(
            req.environ, 'GET', path).get_response(self.app)
        if resp.status_int // 100 != 2 and resp.status_int != 404:
            raise Exception('Could not obtain .services object: %s %s' %
                            (path, resp.status))
        if resp.status_int // 100 == 2:
            services = json.loads(resp.body)
            # Delete the account on each cluster it is on.
            deleted_any = False
            for name, url in services['storage'].iteritems():
                if name != 'default':
                    parsed = urlparse(url)
                    conn = self.get_conn(parsed)
                    conn.request('DELETE', parsed.path,
                        headers={'X-Auth-Token': self.get_itoken(req.environ)})
                    resp = conn.getresponse()
                    resp.read()
                    if resp.status == 409:
                        if deleted_any:
                            raise Exception('Managed to delete one or more '
                                'service end points, but failed with: '
                                '%s %s %s' % (url, resp.status, resp.reason))
                        else:
                            return HTTPConflict(request=req)
                    if resp.status // 100 != 2 and resp.status != 404:
                        raise Exception('Could not delete account on the '
                            'Swift cluster: %s %s %s' %
                            (url, resp.status, resp.reason))
                    deleted_any = True
            # Delete the .services object itself.
            path = quote('/v1/%s/%s/.services' %
                         (self.auth_account, account))
            resp = self.make_pre_authed_request(
                req.environ, 'DELETE', path).get_response(self.app)
            if resp.status_int // 100 != 2 and resp.status_int != 404:
                raise Exception('Could not delete .services object: %s %s' %
                                (path, resp.status))
        # Delete the account id mapping for the account.
        path = quote('/v1/%s/.account_id/%s' %
                     (self.auth_account, account_id))
        resp = self.make_pre_authed_request(
            req.environ, 'DELETE', path).get_response(self.app)
        if resp.status_int // 100 != 2 and resp.status_int != 404:
            raise Exception('Could not delete account id mapping: %s %s' %
                            (path, resp.status))
        # Delete the account marker itself.
        path = quote('/v1/%s/%s' % (self.auth_account, account))
        resp = self.make_pre_authed_request(
            req.environ, 'DELETE', path).get_response(self.app)
        if resp.status_int // 100 != 2 and resp.status_int != 404:
            raise Exception('Could not delete account marked: %s %s' %
                            (path, resp.status))
        return HTTPNoContent(request=req)
854665
private void requestAccountName() {
        GraphUserCallback callback = new GraphUserCallback() {
            @Override
            public void onCompleted(GraphUser user, Response response) {
                FacebookSettingsActivity activity = (FacebookSettingsActivity) getActivity();
                if (activity == null || activity.isFinishing()) {
                    return;
                }

                if (response != null && response.getError() == null && user != null) {
                    String accountName = user.getFirstName() + " " + user.getLastName();
                    if (accountName != null && accountName.length() > 0) {
                        activity.mAccountName = accountName;
                    } else {
                        activity.mHasErrorOccurred = true;
                    }
                } else {
                    activity.mHasErrorOccurred = true;
                }

                activity.tryFinish();
            }
        };

        mFacebookEndpoint.requestAccountName(callback);
    }
473686
def my_requests_view(request):
    '''
    
    '''
    page_name = "Your Requests"
    userProfile = UserProfile.objects.get(user=request.user)
    my_requests = Request.objects.filter(owner=userProfile)
    # A pseudo dictionary, actually a list with items of form
    # (request_type.name.title(), request_form, type_manager, [(request,
    # [list_of_request_responses], response_form, upvote, vote_form),...],
    # relevant_managers)
    request_dict = list()
    for request_type in RequestType.objects.all():
        relevant_managers = request_type.managers.filter(active=True)
        type_manager = any(i.incumbent == userProfile for i in
                           relevant_managers)
        # Items are of form (request, [list_of_request_responses],
        # response_form),...])
        requests_list = list()
        type_requests = my_requests.filter(request_type=request_type)
        for req in type_requests:
            responses_list = Response.objects.filter(request=req)
            if type_manager:
                response_form = ManagerResponseForm(
                    request.POST if "add_response-{0}".format(req.pk) in request.POST else None,
                    initial={'action': Response.NONE},
                    profile=userProfile,
                    request=req,
                    prefix="response-{0}".format(req.pk),
                    )
            else:
                response_form = ResponseForm(
                    request.POST if "add_response-{0}".format(req.pk) in request.POST else None,
                    profile=userProfile,
                    request=req,
                    prefix="response-{0}".format(req.pk),
                    )

            upvote = userProfile in req.upvotes.all()
            vote_form = VoteForm(
                request.POST if "vote-{0}".format(req.pk) in request.POST else None,
                request.POST or None,
                profile=userProfile,
                request=req,
                prefix="vote-{0}",
                )

            if response_form.is_valid():
                response_form.save()
                return HttpResponseRedirect(reverse('managers:my_requests'))
            if vote_form.is_valid():
                vote_form.save()
                return HttpResponseRedirect(reverse('managers:my_requests'))

            requests_list.append((req, responses_list, response_form, upvote, vote_form))
        request_form = RequestForm(
            request.POST if "submit_request" in request.POST else None,
            profile=userProfile,
            request_type=request_type,
            prefix="request-{0}".format(request_type.pk),
            )
        if request_form.is_valid():
            request_form.save()
            return HttpResponseRedirect(reverse('managers:my_requests'))
        request_dict.append((request_type, request_form, type_manager,
                             requests_list, relevant_managers))
    return render_to_response('my_requests.html', {
        'page_name': page_name,
        'request_dict': request_dict,
        }, context_instance=RequestContext(request))
275166
def put(self, accountId):
        """"""
        self.reqparse.add_argument('accountName', type=str, required=True)
        self.reqparse.add_argument('accountType', type=str, required=True)
        self.reqparse.add_argument('contacts', type=dict, required=True, action='append')
        self.reqparse.add_argument('enabled', type=int, required=True, choices=(0, 1))
        self.reqparse.add_argument('requiredRoles', type=str, action='append', default=())
        self.reqparse.add_argument('properties', type=dict, required=True)
        args = self.reqparse.parse_args()

        account_class = get_plugin_by_name(PLUGIN_NAMESPACES['accounts'], args['accountType'])
        if not account_class:
            raise InquisitorError('Invalid account type: {}'.format(args['accountType']))

        validate_contacts(args['contacts'])

        if not args['accountName'].strip():
            raise Exception('You must provide an account name')

        if not args['contacts']:
            raise Exception('You must provide at least one contact')

        class_properties = {from_camelcase(key): value for key, value in args['properties'].items()}
        for prop in account_class.class_properties:
            if prop['key'] not in class_properties:
                raise InquisitorError('Missing required property {}'.format(prop))

        account = account_class.get(accountId)
        if account.account_type != args['accountType']:
            raise InquisitorError('You cannot change the type of an account')

        account.account_name = args['accountName']
        account.contacts = args['contacts']
        account.enabled = args['enabled']
        account.required_roles = args['requiredRoles']
        account.update(**args['properties'])
        account.save()

        auditlog(event='account.update', actor=session['user'].username, data=args)

        return self.make_response({'message': 'Object updated', 'account': account.to_json(is_admin=True)})
219434
def get_account_details(self, account):
        
        _form = mechanize.HTMLForm(self.SEARCH_MEMBERS_URL, method="POST")
        _form.new_control('text', 'username', {'value': account})
        _form.new_control('text', '_', {'value': ''})

        try:
            r = self.post_url(self.SEARCH_MEMBERS_URL, form=_form)
        except AuthRequiredException:
            self._auth()
            r = self.post_url(self.SEARCH_MEMBERS_URL, form=_form)

        if r:
            # single quoted json parameters are not valid so convert
            # them into double quoted parameters
            _decoded = json.loads(r.replace("'", '"'))
            # we have a double array result so retrieve only what's
            # essential
            if _decoded[0]:
                return _decoded[0][0]

        raise InvalidAccountException
276773
function (validBidRequests, bidderRequest) {
    let requests = [];

    validBidRequests.forEach(bid => {
      let url = generateUrl(bid, bidderRequest);
      if (url) {
        requests.push({
          method: 'GET',
          url: generateUrl(bid, bidderRequest),
          bidId: bid.bidId,
          vastUrl: url.split('&fmt=json')[0]
        });
      }
    });

    return requests;
  }
639528
function getOrder(account, identifier, callback) {
  validate.address(account);
  validate.identifier(identifier);

  var txRequest = this.remote.requestTx({
    hash: identifier
  });

  txRequest.once('error', callback);
  txRequest.once('transaction', function(response) {
    if (response.TransactionType !== 'OfferCreate'
        && response.TransactionType !== 'OfferCancel') {
      callback(new InvalidRequestError('Invalid parameter: identifier. '
        + 'The transaction corresponding to the given identifier '
        + 'is not an order'));
    } else {
      var options = {
        account: account,
        identifier: identifier
      };
      asyncify(TxToRestConverter.parseOrderFromTx)(response, options, callback);
    }
  });
  txRequest.request();
}
951442
function parseAccountList(resp) {
  return new Promise((resolve, reject) => {
    const $ = cheerio.load(resp.body);
    const accountRows = $('.main_group_account_row');

    if (!accountRows || accountRows.length === 0) {
      return reject(new Error('Cannot find account list.'));
    }

    const accounts = [];
    accountRows.each((index, elem) => {
      try {
        const $$ = cheerio.load(elem);
        const account = {
          name: $$('.NicknameField .left a')
            .text()
            .trim(),
          link: $$('.NicknameField .left a').attr('href'),
          bsb: $$('.BSBField .text')
            .text()
            .replace(/\s+/g, '')
            .trim(),
          account: $$('.AccountNumberField .text')
            .text()
            .replace(/\s+/g, '')
            .trim(),
          balance: parseCurrencyHtml($$('.AccountBalanceField')),
          available: parseCurrencyHtml($$('.AvailableFundsField')),
        };
        //  Assemble the `bsb` and `account` to construct `number`
        account.number = `${account.bsb}${account.account}`;
        account.type = `${/ACCOUNT_PRODUCT_TYPE=(\w+)/.exec(account.link)[1]}`;
        //  push to the final account list if it's valid
        if (account.name && account.link && account.account) {
          accounts.push(account);
        }
      } catch (err) {
        debug(`parseAccountList(): ${err}`);
        debug(`parseAccountList(): elem => ${util.inspect(elem)}`);
      }
    });

    debug(`parseAccountList(): found ${accounts.length} accounts`);
    return resolve(Object.assign({}, resp, { accounts }));
  });
}
83772
def list_all_requests_view(request, requestType):
    '''
    
    '''
    request_type = get_object_or_404(RequestType, url_name=requestType)
    requests = Request.objects.filter(request_type=request_type)
    # Hide the count for private requests
    if not request_type.managers.filter(incumbent__user=request.user):
        requests = requests.exclude(
            ~Q(owner__user=request.user), private=True,
            )

    page_name = "Archives - All {0} Requests".format(request_type.name.title())
    return render_to_response('list_requests.html', {
        'page_name': page_name,
        'requests': requests,
        'request_type': request_type,
        }, context_instance=RequestContext(request))