repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
imiMoisesEducation/beatcookie-discbot
build/python-env/lib/python2.7/site-packages/elasticsearch/client/xpack/ml.py
59c8be23346d8d2fc1777a2b08856df88e2ae5c2
from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH class MlClient(NamespacedClient): @query_params('from_', 'size') def get_filters(self, filter_id=None, params=None): """ :arg filter_id: The ID of the filter to fetch :arg from_: skips a num...
[((136, 165), 'elasticsearch.client.utils.query_params', 'query_params', (['"""from_"""', '"""size"""'], {}), "('from_', 'size')\n", (148, 165), False, 'from elasticsearch.client.utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH\n'), ((543, 557), 'elasticsearch.client.utils.query_params', 'query_par...
LaudateCorpus1/oci-python-sdk
src/oci/service_catalog/service_catalog_client_composite_operations.py
b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015
# coding: utf-8 # Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
[((3626, 3713), 'oci.exceptions.CompositeOperationError', 'oci.exceptions.CompositeOperationError', ([], {'partial_results': '[operation_result]', 'cause': 'e'}), '(partial_results=[operation_result],\n cause=e)\n', (3664, 3713), False, 'import oci\n'), ((5780, 5867), 'oci.exceptions.CompositeOperationError', 'oci.e...
BrianOfrim/boja
vision/_file_utils.py
6571fbbfb7f015e96e80e822d9dc96b4636b4119
from typing import List import os import re def create_output_dir(dir_name) -> bool: if not os.path.isdir(dir_name) or not os.path.exists(dir_name): print("Creating output directory: %s" % dir_name) try: os.makedirs(dir_name) except OSError: print("Creation of the d...
[((1730, 1775), 'os.path.join', 'os.path.join', (['dir_path', 'highest_numbered_file'], {}), '(dir_path, highest_numbered_file)\n', (1742, 1775), False, 'import os\n'), ((604, 627), 'os.path.isdir', 'os.path.isdir', (['dir_path'], {}), '(dir_path)\n', (617, 627), False, 'import os\n'), ((968, 995), 'os.path.basename', ...
COVID-IWG/epimargin-studies
vaccine_allocation/epi_simulations.py
7d4a78e2e6713c6a0aea2cd2440529153e9a635d
import dask import numpy as np import pandas as pd from epimargin.models import Age_SIRVD from epimargin.utils import annually, normalize, percent, years from studies.vaccine_allocation.commons import * from tqdm import tqdm import warnings warnings.filterwarnings("error") num_sims = 1000 simulation_range = 1...
[((242, 274), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""error"""'], {}), "('error')\n", (265, 274), False, 'import warnings\n'), ((937, 1076), 'numpy.savez_compressed', 'np.savez_compressed', (["(dst / f'{tag}.npz')"], {'dT': 'policy.dT_total', 'dD': 'policy.dD_total', 'pi': 'policy.pi', 'q0': 'policy...
nandofioretto/py_dcop
src/core/agent_state.py
fb2dbc97b69360f5d1fb67d84749e44afcdf48c3
'''Every agent has an agent state, which is its local view of the world''' import numpy as np import itertools class AgentState: def __init__(self, name, agt, seed=1234): self.name = name self.prng = np.random.RandomState(seed) # contains the variable assignment (exploreD) for this agent a...
[((221, 248), 'numpy.random.RandomState', 'np.random.RandomState', (['seed'], {}), '(seed)\n', (242, 248), True, 'import numpy as np\n'), ((837, 864), 'itertools.product', 'itertools.product', (['*domains'], {}), '(*domains)\n', (854, 864), False, 'import itertools\n')]
Sonictherocketman/cache-proxy
johnny_cache/__init__.py
75650fb143b365e922c03f87e388c5710ad21799
from .server import app # noqa
[]
usgs/neversink_workflow
python_packages_static/flopy/mf6/__init__.py
acd61435b8553e38d4a903c8cd7a3afc612446f9
# imports from . import coordinates from . import data from .modflow import * from . import utils from .data import mfdatascalar, mfdatalist, mfdataarray from .mfmodel import MFModel from .mfbase import ExtFileAction
[]
issuu/jmespath
tests/__init__.py
7480643df8ad0c99269b1fa6b9e793582bcb7efe
import sys # The unittest module got a significant overhaul # in 2.7, so if we're in 2.6 we can use the backported # version unittest2. if sys.version_info[:2] == (2, 6): import unittest2 as unittest import simplejson as json from ordereddict import OrderedDict else: import unittest import json ...
[]
jtillman20/cfb-data-api
src/routes/scoring.py
69bcae225e4fa0616eb526bd608e20ace17f1816
from typing import Union from flask import request from flask_restful import Resource from exceptions import InvalidRequestError from models import Scoring from utils import flask_response, rank, sort class ScoringRoute(Resource): @flask_response def get(self, side_of_ball: str) -> Union[Scoring, list[Scori...
[((875, 918), 'flask.request.args.get', 'request.args.get', (['"""sort"""', '"""points_per_game"""'], {}), "('sort', 'points_per_game')\n", (891, 918), False, 'from flask import request\n'), ((1380, 1408), 'flask.request.args.get', 'request.args.get', (['"""end_year"""'], {}), "('end_year')\n", (1396, 1408), False, 'fr...
ZFMK/GermanBarcodeofLife
WebPortal/gbol_portal/vars.py
f9e9af699ba3f5b3d0d537819a8463c4162d7e82
import configparser c = configparser.ConfigParser() c.read("production.ini") config = {} config['host'] = c['dboption']['chost'] config['port'] = int(c['dboption']['cport']) config['user'] = c['dboption']['cuser'] config['pw'] = c['dboption']['cpw'] config['db'] = c['dboption']['cdb'] config['homepath'] = c['option'][...
[((25, 52), 'configparser.ConfigParser', 'configparser.ConfigParser', ([], {}), '()\n', (50, 52), False, 'import configparser\n')]
HernandezDerekJ/Interview
challenges/Backend Challenge/pendulum_sort.py
202d78767d452ecfe8c6220180d7ed53b1104231
""" Coderpad solution """ def pend(arr): ## arr = [2,3,5,1,4] ## vrr = [0,0,0,0,0] var = [0] * len(arr) mid = (len(var) - 1) / 2 ## sort_arr = [1,2,3,4,5] ## vrr = [0,0,1,0,0] sort_arr = sorted(arr) var[mid] = sort_arr[0] # ^ # focus...
[]
garagonc/optimization-framework
swagger_server/controllers/threadFactory.py
1ca57699d6a3f2f98dcaea96430e75c3f847b49f
import os import configparser import json import time from IO.inputConfigParser import InputConfigParser from IO.redisDB import RedisDB from optimization.ModelException import MissingKeysException from optimization.controllerDiscrete import OptControllerDiscrete from optimization.controllerMpc import OptControllerMPC...
[((963, 1001), 'utils_intern.messageLogger.MessageLogger.get_logger', 'MessageLogger.get_logger', (['__name__', 'id'], {}), '(__name__, id)\n', (987, 1001), False, 'from utils_intern.messageLogger import MessageLogger\n'), ((1357, 1366), 'IO.redisDB.RedisDB', 'RedisDB', ([], {}), '()\n', (1364, 1366), False, 'from IO.r...
xann16/py-path-tracing
ptrace/oop/math_tests.py
609dbe6b80580212bd9d8e93afb6902091040d7a
"""Unit tests for math-oriented common classes.""" import unittest import math import numpy as np from .vector import Vec3, OrthonormalBasis from .raycast_base import Ray from .camera import Camera class Vec3Tests(unittest.TestCase): """Test for Vec3 class.""" def test_vec3_basic(self): """Basic cr...
[((8125, 8140), 'unittest.main', 'unittest.main', ([], {}), '()\n', (8138, 8140), False, 'import unittest\n'), ((443, 484), 'numpy.array', 'np.array', (['[0.1, 0.2, 0.3]'], {'dtype': '"""double"""'}), "([0.1, 0.2, 0.3], dtype='double')\n", (451, 484), True, 'import numpy as np\n'), ((4121, 4133), 'math.sqrt', 'math.sqr...
kianku/selene
tests/integration/condition__browser__have_url_test.py
5361938e4f34d6cfae6df3aeca80e06a3e657d8c
# MIT License # # Copyright (c) 2015-2020 Iakiv Kramarenko # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modif...
[((1424, 1468), 'selene.have.url', 'have.url', (['session_browser.driver.current_url'], {}), '(session_browser.driver.current_url)\n', (1432, 1468), False, 'from selene import have\n'), ((1497, 1549), 'selene.have.no.url', 'have.no.url', (['session_browser.driver.current_url[:-1]'], {}), '(session_browser.driver.curren...
chandrashekar-cohesity/management-sdk-python
cohesity_management_sdk/models/scheduling_policy.py
9e6ec99e8a288005804b808c4e9b19fd204e3a8b
# -*- coding: utf-8 -*- # Copyright 2019 Cohesity Inc. import cohesity_management_sdk.models.continuous_schedule import cohesity_management_sdk.models.daily_schedule import cohesity_management_sdk.models.monthly_schedule import cohesity_management_sdk.models.rpo_schedule class SchedulingPolicy(object): """Implem...
[]
mail2nsrajesh/networking-mlnx
networking_mlnx/eswitchd/cli/ebrctl.py
9051eac0c2bc6abf3c8790e01917e405dc479922
#!/usr/bin/python # Copyright 2013 Mellanox Technologies, Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[((752, 773), 'networking_mlnx.eswitchd.cli.conn_utils.ConnUtil', 'conn_utils.ConnUtil', ([], {}), '()\n', (771, 773), False, 'from networking_mlnx.eswitchd.cli import conn_utils\n'), ((1098, 1136), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'prog': '"""ebrctl"""'}), "(prog='ebrctl')\n", (1121, 1136), ...
paskino/SuRVoS
survos/core/__init__.py
e01e784442e2e9f724826cdb70f3a50c034c6455
from .launcher import Launcher from .model import DataModel from .layers import LayerManager from .labels import LabelManager from .singleton import Singleton
[]
Chahat-M/FinanceLib
src/FinanceLib/analysis.py
0428779220a97e7fe0ad35a50207b737059b9c86
from typing import List, Union import numpy as np import pandas_datareader as pdr import pandas as pd import matplotlib.pyplot as plt def rsi(symbol :str ,name :str, date :str) -> None : """ Calculates and visualises the Relative Stock Index on a Stock of the company. Parameters: symbol(str) : Sy...
[((620, 652), 'pandas_datareader.get_data_yahoo', 'pdr.get_data_yahoo', (['symbol', 'date'], {}), '(symbol, date)\n', (638, 652), True, 'import pandas_datareader as pdr\n'), ((1072, 1087), 'matplotlib.pyplot.subplots', 'plt.subplots', (['(2)'], {}), '(2)\n', (1084, 1087), True, 'import matplotlib.pyplot as plt\n'), ((1...
jbenet/datastore
datastore/core/test/test_basic.py
6c0e9f39b844788ca21c5cf613c625a72fb20c20
import unittest import logging from ..basic import DictDatastore from ..key import Key from ..query import Query class TestDatastore(unittest.TestCase): def subtest_simple(self, stores, numelems=1000): def checkLength(len): try: for sn in stores: self.assertEqual(len(sn), numelems) ...
[]
Neisvestney/SentSyncServer
rooms/models.py
45e9572b6c9b274ed2cbad28749fcb2154c98757
from django.db import models class Room(models.Model): code = models.CharField('Code', max_length=128) tab_url = models.CharField('Tab url', max_length=512, default='', blank=True) def to_dict(self): return { 'users': [u.to_dict() for u in self.users.all()], 'tabUrl': self...
[((68, 108), 'django.db.models.CharField', 'models.CharField', (['"""Code"""'], {'max_length': '(128)'}), "('Code', max_length=128)\n", (84, 108), False, 'from django.db import models\n'), ((123, 190), 'django.db.models.CharField', 'models.CharField', (['"""Tab url"""'], {'max_length': '(512)', 'default': '""""""', 'bl...
techthiyanes/ColBERT
colbert/parameters.py
6493193b98d95595f15cfc375fed2f0b24df4f83
import torch DEVICE = torch.device("cuda") SAVED_CHECKPOINTS = [32*1000, 100*1000, 150*1000, 200*1000, 300*1000, 400*1000] SAVED_CHECKPOINTS += [10*1000, 20*1000, 30*1000, 40*1000, 50*1000, 60*1000, 70*1000, 80*1000, 90*1000] SAVED_CHECKPOINTS += [25*1000, 50*1000, 75*1000] SAVED_CHECKPOINTS = set(SAVED_CHECKPOINTS)...
[((23, 43), 'torch.device', 'torch.device', (['"""cuda"""'], {}), "('cuda')\n", (35, 43), False, 'import torch\n')]
aburgd/sheila
jarvis/stats.py
556cf3e4a6992b8ba609ba281f5a3657cd91e709
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import pyscp import textwrap from dominate import tags as dt from . import core, lex, ext ########################...
[((5816, 5847), 'pyscp.wikidot.Wiki', 'pyscp.wikidot.Wiki', (['"""scp-stats"""'], {}), "('scp-stats')\n", (5834, 5847), False, 'import pyscp\n'), ((2134, 2162), 'textwrap.indent', 'textwrap.indent', (['row', '""" """'], {}), "(row, ' ')\n", (2149, 2162), False, 'import textwrap\n'), ((2215, 2249), 'textwrap.inden...
Allenyou1126/allenyou-acme.sh
entry.py
2f5fa606cb0a66ded49d75a98d0dc47adc68c87c
#!/usr/bin/env python3 import json from allenyoucert import Cert def main(): certList = list() a = json() main()
[((109, 115), 'json', 'json', ([], {}), '()\n', (113, 115), False, 'import json\n')]
quantmind/dynts
dynts/lib/fallback/simplefunc.py
21ac57c648bfec402fa6b1fe569496cf098fb5e8
from .common import * def tsminmax(v): mv = NaN xv = NaN for v in x: if x == x: if mv == mv: mv = min(mv,x) else: mv = x if xv == xv: xv = max(xv,x) else: xv = x retu...
[]
lcsm29/edx-harvard-cs50
week9/finance/application.py
283f49bd6a9e4b8497e2b397d766b64527b4786b
import os from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session from flask_session import Session from tempfile import mkdtemp from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError from werkzeug.security import check_password_hash, generate_pa...
[((421, 436), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (426, 436), False, 'from flask import Flask, flash, redirect, render_template, request, session\n'), ((932, 941), 'tempfile.mkdtemp', 'mkdtemp', ([], {}), '()\n', (939, 941), False, 'from tempfile import mkdtemp\n'), ((1024, 1036), 'flask_session...
iurykrieger96/alura-django
users/forms.py
d8ed9998ccbc629127b2c6ca3ed3798da9a578f3
from django import forms from django.contrib.auth.models import User from django.forms.utils import ErrorList class UserForm(forms.Form): name = forms.CharField(required=True) email = forms.EmailField(required=True) password = forms.CharField(required=True) phone = forms.CharField(required=True) n...
[((151, 181), 'django.forms.CharField', 'forms.CharField', ([], {'required': '(True)'}), '(required=True)\n', (166, 181), False, 'from django import forms\n'), ((194, 225), 'django.forms.EmailField', 'forms.EmailField', ([], {'required': '(True)'}), '(required=True)\n', (210, 225), False, 'from django import forms\n'),...
Kiku-Reise/vsmart
python/manager.py
dd8cf84816da8734e72dbb46c07694f561597648
from telethon.sync import TelegramClient from telethon.errors.rpcerrorlist import PhoneNumberBannedError import pickle, os from colorama import init, Fore from time import sleep init() n = Fore.RESET lg = Fore.LIGHTGREEN_EX r = Fore.RED w = Fore.WHITE cy = Fore.CYAN ye = Fore.YELLOW colors = [lg, r, w, cy, ye] try: ...
[((179, 185), 'colorama.init', 'init', ([], {}), '()\n', (183, 185), False, 'from colorama import init, Fore\n'), ((421, 454), 'os.system', 'os.system', (['"""pip install requests"""'], {}), "('pip install requests')\n", (430, 454), False, 'import pickle, os\n'), ((1014, 1030), 'os.system', 'os.system', (['"""cls"""'],...
rus-kh/m2ee-tools
src/m2ee/client_errno.py
70000796a53131bb1cd8d199f48cd5e7aab2c505
# # Copyright (C) 2009 Mendix. All rights reserved. # SUCCESS = 0 # Starting the Mendix Runtime can fail in both a temporary or permanent way. # Some of the errors can be fixed with some help of the user. # # The default m2ee cli program will only handle a few of these cases, by # providing additional hints or intera...
[]
andrewliao11/detr
datasets/__init__.py
944bb60e090e6b72aede9574cd2b7f75202cfe05
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import torch.utils.data import torchvision def get_coco_api_from_dataset(dataset_val): for _ in range(10): # if isinstance(dataset, torchvision.datasets.CocoDetection): # break if isinstance(dataset_val, torch.utils...
[]
sansbacon/dkhomeleague
dkhomeleague/dkhomeleague.py
17ab695df9ceccf5b7f135181b19ade8d47add5f
# dkhomeleague.py import json import logging import os from string import ascii_uppercase import pandas as pd from requests_html import HTMLSession import browser_cookie3 import pdsheet class Scraper: """scrapes league results""" def __init__(self, league_key=None, username=None): """Creates instan...
[((724, 737), 'requests_html.HTMLSession', 'HTMLSession', ([], {}), '()\n', (735, 737), False, 'from requests_html import HTMLSession\n'), ((1310, 1335), 'browser_cookie3.firefox', 'browser_cookie3.firefox', ([], {}), '()\n', (1333, 1335), False, 'import browser_cookie3\n'), ((4779, 4802), 'pandas.DataFrame', 'pd.DataF...
Wadden12/Semester1
Graphing/Example1.py
a13c4486848daec3b5865e8a2a778689c81528fe
#!/usr/bin/python3 import numpy as np import matplotlib.pyplot as plt t = np.arange(0.0, 3.0, 0.01) s = np.sin(2.5 * np.pi * t) plt.plot(t, s) plt.xlabel('time (s)') plt.ylabel('voltage (mV)') plt.title('Sine Wave') plt.grid(True) plt.show()
[((76, 101), 'numpy.arange', 'np.arange', (['(0.0)', '(3.0)', '(0.01)'], {}), '(0.0, 3.0, 0.01)\n', (85, 101), True, 'import numpy as np\n'), ((106, 129), 'numpy.sin', 'np.sin', (['(2.5 * np.pi * t)'], {}), '(2.5 * np.pi * t)\n', (112, 129), True, 'import numpy as np\n'), ((130, 144), 'matplotlib.pyplot.plot', 'plt.plo...
gentildf/Python
Cursoemvideo/desafios/desafio008.py
bb333e55b197492eac1294619ca7b13ef57bb631
#Escreva um programa que leia um valor em metros e o exiba convertido em centimetros e milimetros. n = float(input('\033[32mDigite o numero:\033[m')) print('O número digitado é \033[33m{0:.0f}m\033[m.\n' 'Ele apresentado em centimetros fica \033[33m{0:.2f}cm\033[m.\n' 'Apresentado em milímetros fica \033[33...
[]
Dordoloy/BachelorDIM-Lectures-Algorithms-2019
publish_fanout.py
14e3e7132eecf62e3476dbea4d9db32adf1544ff
# -*- coding: utf-8 -*- """ Created on Mon Oct 21 08:47:08 2019 @author: dordoloy """ import os import pika import config import getpass def publish_fanout(): amqp_url=config.amqp_url # Parse CLODUAMQP_URL (fallback to localhost) url = os.environ.get('CLOUDAMQP_URL',amqp_url) params = pika...
[((262, 303), 'os.environ.get', 'os.environ.get', (['"""CLOUDAMQP_URL"""', 'amqp_url'], {}), "('CLOUDAMQP_URL', amqp_url)\n", (276, 303), False, 'import os\n'), ((316, 339), 'pika.URLParameters', 'pika.URLParameters', (['url'], {}), '(url)\n', (334, 339), False, 'import pika\n'), ((392, 423), 'pika.BlockingConnection',...
xjx0524/models
orbit/utils.py
99be973aa8168a0d2275d475883b3256b193251f
<<<<<<< HEAD # Lint as: python3 ======= >>>>>>> a811a3b7e640722318ad868c99feddf3f3063e36 # Copyright 2020 The Orbit Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License ...
[]
whitepeaony/exercism-python
python/word-count/word_count.py
5c947ba5c589f1969bcb754e88969420262c457e
def count_words(sentence): sentence = sentence.lower() words = {} shit = ',\n:!&@$%^&._' for s in shit: sentence = sentence.replace(s, ' ') for w in sentence.split(): if w.endswith('\''): w = w[:-1] if w.startswith('\''): w = w[1:] words...
[]
klauer/apischema
examples/multiple_deserializers.py
0da9b96b74dabe8704e2dcfca4502aed98500799
from dataclasses import dataclass from apischema import deserialize, deserializer from apischema.json_schema import deserialization_schema @dataclass class Expression: value: int @deserializer def evaluate_expression(expr: str) -> Expression: return Expression(int(eval(expr))) # Could be shorten into des...
[((478, 512), 'apischema.json_schema.deserialization_schema', 'deserialization_schema', (['Expression'], {}), '(Expression)\n', (500, 512), False, 'from apischema.json_schema import deserialization_schema\n'), ((625, 651), 'apischema.deserialize', 'deserialize', (['Expression', '(0)'], {}), '(Expression, 0)\n', (636, 6...
txtbits/daw-python
ficheros/CSV/prueba csv (lm)/alumnos.py
5dde1207e2791e90aa5e9ce2b6afc4116129efab
# -*- coding: utf-8 -*- ''' Created on 02/12/2011 @author: chra ''' import csv from operator import itemgetter # ----- Función media de la notas de los alumnos ---------- def media(alumno): #devuelve la nota media a partir de un diccionario con datos de un alumno nota1 = int(alumno['Nota1']) nota2 = int...
[]
incrementals/b-star
src/interpreter/functions/math/math.py
325bb51eafd5c5173582bf065b82d10ef9669275
from src.interpreter.functions.math.add import add from src.interpreter.functions.math.div import div from src.interpreter.functions.math.mod import mod from src.interpreter.functions.math.mul import mul from src.interpreter.functions.math.pow import pow_func from src.interpreter.functions.math.sub import sub def mat...
[((426, 441), 'src.interpreter.functions.math.add.add', 'add', (['number', 'by'], {}), '(number, by)\n', (429, 441), False, 'from src.interpreter.functions.math.add import add\n'), ((483, 498), 'src.interpreter.functions.math.sub.sub', 'sub', (['number', 'by'], {}), '(number, by)\n', (486, 498), False, 'from src.interp...
monkey2000/pygazetteer
setup.py
3eb6026b1473f773817a81ebc0060ec455482739
from setuptools import setup setup(name='pygazetteer', version='0.1.0', description='Location extractor by looking up gazetteer', url='https://github.com/monkey2000/pygazetteer', license='MIT', packages=['pygazetteer'], install_requires=[ 'pyahocorasick' ], zip...
[((30, 318), 'setuptools.setup', 'setup', ([], {'name': '"""pygazetteer"""', 'version': '"""0.1.0"""', 'description': '"""Location extractor by looking up gazetteer"""', 'url': '"""https://github.com/monkey2000/pygazetteer"""', 'license': '"""MIT"""', 'packages': "['pygazetteer']", 'install_requires': "['pyahocorasick'...
mustx1/MYIQ
iqoptionapi/country_id.py
3afb597aa8a8abc278b7d70dad46af81789eae3e
ID = {"Worldwide":0, "AF": 1, "AL": 2, "DZ": 3, "AD": 5, "AO": 6, "AI": 7, "AG": 9, "AR": 10, "AM": 11, "AW": 12, "AT": 14, "AZ": 15, "BS": 16, "BH": 17, "BD": 18, "BB": 19, "BY": 20, "BZ": 22, "BJ": 23, ...
[]
rogersamso/pysd_dev
pysd/py_backend/external.py
85606265aa92878c35a41dd81ce9588d23350e19
""" These classes are a collection of the needed tools to read external data. The External type objects created by these classes are initialized before the Stateful objects by functions.Model.initialize. """ import re import os import warnings import pandas as pd # TODO move to openpyxl import numpy as np import xarr...
[((16001, 16015), 'numpy.isnan', 'np.isnan', (['data'], {}), '(data)\n', (16009, 16015), True, 'import numpy as np\n'), ((16902, 16931), 'numpy.empty_like', 'np.empty_like', (['x'], {'dtype': 'float'}), '(x, dtype=float)\n', (16915, 16931), True, 'import numpy as np\n'), ((19042, 19071), 're.findall', 're.findall', (['...
ksmit799/POTCO-PS
pirates/piratesgui/ChatBar.py
520d38935ae8df4b452c733a82c94dddac01e275
# File: C (Python 2.4) from direct.gui.DirectGui import * from direct.interval.IntervalGlobal import * from direct.fsm.FSM import FSM from direct.showbase.PythonUtil import Functor from pandac.PandaModules import * from pirates.piratesbase import PiratesGlobals from pirates.piratesbase import PLocalizer from pirates.p...
[((803, 846), 'pirates.piratesgui.TabBar.TopTab.__init__', 'TopTab.__init__', (['self', 'tabBar', 'name'], {}), '(self, tabBar, name, **None)\n', (818, 846), False, 'from pirates.piratesgui.TabBar import TopTab, TabBar\n'), ((1500, 1520), 'pirates.piratesgui.TabBar.TopTab.destroy', 'TopTab.destroy', (['self'], {}), '(s...
lucashmorais/x-Bench
mozmill-env/python/Lib/site-packages/mozlog/logger.py
2080b8753dd6e45c2212666bcdb05327752a94e9
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from logging import getLogger as getSysLogger from logging import * # Some of the build slave environments don't see the...
[((581, 597), 'logging.getLoggerClass', 'getLoggerClass', ([], {}), '()\n', (595, 597), False, 'from logging import getLoggerClass, addLevelName, setLoggerClass, shutdown, debug, info, basicConfig\n'), ((866, 899), 'logging.addLevelName', 'addLevelName', (['START', '"""TEST-START"""'], {}), "(START, 'TEST-START')\n", (...
wdobbels/CAAPR
CAAPR/CAAPR_AstroMagic/PTS/pts/core/misc/images.py
50d0b32642a61af614c22f1c6dc3c4a00a1e71a3
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
[((12455, 12469), 'astropy.units.Unit', 'Unit', (['"""micron"""'], {}), "('micron')\n", (12459, 12469), False, 'from astropy.units import Unit\n'), ((13037, 13047), 'astropy.units.Unit', 'Unit', (['"""sr"""'], {}), "('sr')\n", (13041, 13047), False, 'from astropy.units import Unit\n'), ((13050, 13065), 'astropy.units.U...
Hazemcodes/GimmyBot
venv/Lib/site-packages/rivescript/inheritance.py
f24cb90e0d3c045100f59def1d5e14bef367cba7
# RiveScript-Python # # This code is released under the MIT License. # See the "LICENSE" file for more information. # # https://www.rivescript.com/ def get_topic_triggers(rs, topic, thats, depth=0, inheritance=0, inherited=False): """Recursively scan a topic and return a list of all triggers. Arguments: ...
[]
mattmillr/utaka
src/dataAccess/Connection.py
6622e9057c323b0aed1113f8723404d264a7c82e
#Copyright 2009 Humanitarian International Services Group # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or...
[((1144, 1169), 'datetime.datetime.today', 'datetime.datetime.today', ([], {}), '()\n', (1167, 1169), False, 'import datetime\n'), ((1078, 1100), 'utaka.src.dataAccess.SingleConnection.Connection', 'SingleConnection', (['(True)'], {}), '(True)\n', (1094, 1100), True, 'from utaka.src.dataAccess.SingleConnection import C...
DKorytkin/pylint-pytest
setup.py
097b7767e5f33ad512d421bea9ebb74a251f47bd
#!/usr/bin/env python # -*- coding: utf-8 -*- from os import path from setuptools import setup, find_packages here = path.abspath(path.dirname(__file__)) with open(path.join(here, 'README.md')) as fin: long_description = fin.read() setup( name='pylint-pytest', version='1.0.3', author='Reverb Chu', ...
[((133, 155), 'os.path.dirname', 'path.dirname', (['__file__'], {}), '(__file__)\n', (145, 155), False, 'from os import path\n'), ((167, 195), 'os.path.join', 'path.join', (['here', '"""README.md"""'], {}), "(here, 'README.md')\n", (176, 195), False, 'from os import path\n'), ((696, 739), 'setuptools.find_packages', 'f...
lismore/OffensiveCyberTools
Shells/Python/Client/TCPReverseShell.py
c43fb78f0067498e53cfa5aad9e0fd60ebd6e069
# Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments # Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore #========================================================================================================================================= # Python...
[((420, 469), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (433, 469), False, 'import socket\n'), ((1233, 1350), 'subprocess.Popen', 'subprocess.Popen', (['sentCommand'], {'shell': '(True)', 'stdout': 'subprocess.PIPE', 'stderr': 'subprocess...
balabit-deps/balabit-os-6-python-cryptography
src/_cffi_src/openssl/engine.py
c31d184a56a18bad89a6444313367be71b5b0877
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function INCLUDES = """ #include <openssl/engine.h> """ TYPES = """ static const ...
[]
AlexandruScrob/fast_api_proj_2
tests/products/test_products.py
9aca5d48ab3e42933747b23ff04c6d4f3487d93e
import pytest from httpx import AsyncClient from conf_test_db import app from tests.shared.info import category_info, product_info @pytest.mark.asyncio async def test_new_product(): async with AsyncClient(app=app, base_url="http://test") as ac: category_obj = await category_info() payload = { ...
[((200, 244), 'httpx.AsyncClient', 'AsyncClient', ([], {'app': 'app', 'base_url': '"""http://test"""'}), "(app=app, base_url='http://test')\n", (211, 244), False, 'from httpx import AsyncClient\n'), ((927, 971), 'httpx.AsyncClient', 'AsyncClient', ([], {'app': 'app', 'base_url': '"""http://test"""'}), "(app=app, base_u...
utiasSTARS/matchable-image-transforms
3rdparty/pyviso2/src/viso2.py
2c723872ef82e51dfa32abd3bbcec8410cb7dd2d
# This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info >= (2, 7, 0): def swig_im...
[((26063, 26083), '_viso2.Matrix_eye', '_viso2.Matrix_eye', (['m'], {}), '(m)\n', (26080, 26083), False, 'import _viso2\n'), ((26151, 26172), '_viso2.Matrix_diag', '_viso2.Matrix_diag', (['M'], {}), '(M)\n', (26169, 26172), False, 'import _viso2\n'), ((26258, 26288), '_viso2.Matrix_reshape', '_viso2.Matrix_reshape', ([...
Yandawl/restcord.py
restcord/http.py
eeaf75f4a3d05f3837906a60d5f4a9395c4933ff
# -*- coding: utf-8 -*- import asyncio import datetime import json import logging import sys from typing import Optional import aiohttp from aiohttp import ClientSession from . import __version__ from .errors import ( BadGateway, BadRequest, Forbidden, HTTPException, InternalServerError, NotFo...
[((354, 381), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (371, 381), False, 'import logging\n'), ((4193, 4250), 'json.dumps', 'json.dumps', (['obj'], {'separators': "(',', ':')", 'ensure_ascii': '(True)'}), "(obj, separators=(',', ':'), ensure_ascii=True)\n", (4203, 4250), False, 'imp...
Anmol-Singh-Jaggi/interview-notes
notes/algo-ds-practice/problems/graph/mother_vertex.py
65af75e2b5725894fa5e13bb5cd9ecf152a0d652
''' What is a Mother Vertex? A mother vertex in a graph G = (V,E) is a vertex v such that all other vertices in G can be reached by a path from v. How to find mother vertex? Case 1:- Undirected Connected Graph : In this case, all the vertices are mother vertices as we can reach to all the other nodes in the graph...
[]
MoShitrit/kubernetes-controller-example
app/config.py
210a75ddf9c423c55be248ed21f2b6dea160a782
#!/usr/bin/env python # -*- coding: utf-8 -*- import os class Config: api_group = os.environ.get('API_GROUP', 'hello-k8s.s5t.dev') auth_method = os.environ.get("AUTH_METHOD", "cluster") examples_plural = os.environ.get('API_PLURAL', 'examples') examples_version = os.environ.get('API_VERSION', 'v1alpha...
[((88, 136), 'os.environ.get', 'os.environ.get', (['"""API_GROUP"""', '"""hello-k8s.s5t.dev"""'], {}), "('API_GROUP', 'hello-k8s.s5t.dev')\n", (102, 136), False, 'import os\n'), ((155, 195), 'os.environ.get', 'os.environ.get', (['"""AUTH_METHOD"""', '"""cluster"""'], {}), "('AUTH_METHOD', 'cluster')\n", (169, 195), Fal...
greenie-msft/mechanical-markdown
mechanical_markdown/parsers.py
4fb410a34038fab7d270383561726dd4da7a2aca
""" Copyright (c) Microsoft Corporation. Licensed under the MIT License. """ import re import yaml from html.parser import HTMLParser from mistune import Renderer from mechanical_markdown.step import Step start_token = 'STEP' end_token = 'END_STEP' ignore_links_token = 'IGNORE_LINKS' end_ignore_links_token = 'END_...
[((2372, 2412), 'yaml.safe_load', 'yaml.safe_load', (['comment_body[start_pos:]'], {}), '(comment_body[start_pos:])\n', (2386, 2412), False, 'import yaml\n'), ((2506, 2533), 're.match', 're.match', (['"""https?://"""', 'link'], {}), "('https?://', link)\n", (2514, 2533), False, 'import re\n')]
jakepolatty/compliance-checker
cchecker.py
89d362c0616df0267a6a14227fdb9a05daada28e
#!/usr/bin/env python from __future__ import print_function import argparse import sys from compliance_checker.runner import ComplianceChecker, CheckSuite from compliance_checker.cf.util import download_cf_standard_name_table from compliance_checker import __version__ def main(): # Load all available checker cla...
[((343, 355), 'compliance_checker.runner.CheckSuite', 'CheckSuite', ([], {}), '()\n', (353, 355), False, 'from compliance_checker.runner import ComplianceChecker, CheckSuite\n'), ((416, 441), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (439, 441), False, 'import argparse\n'), ((4343, 4404), ...
creimers/djangocms-delete-error
apps/articles/cms_apps.py
f38b8a7a277d98060a2b04d9552f26eff3c1c552
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import gettext as _ class CategoriesAppHook(CMSApp): name = _("Categories") def get_urls(self, page=None, language=None, **kwargs): return ["apps.articles.urls"] apphook_pool.register(CategoriesA...
[((287, 327), 'cms.apphook_pool.apphook_pool.register', 'apphook_pool.register', (['CategoriesAppHook'], {}), '(CategoriesAppHook)\n', (308, 327), False, 'from cms.apphook_pool import apphook_pool\n'), ((170, 185), 'django.utils.translation.gettext', '_', (['"""Categories"""'], {}), "('Categories')\n", (171, 185), True...
sourcelair/bouncer-api
bouncer/blacklist/signals.py
132c63bbd470b0635054ad71656d0303b39ee421
from django.db.models.signals import pre_save from django.dispatch import receiver from blacklist import models from hashlib import sha256 @receiver(pre_save, sender=models.EmailEntry) def email_entry_handler(sender, instance, **kwargs): """ Handler that assigns to lower_case_entry_value the entry_value.lower...
[((142, 186), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'models.EmailEntry'}), '(pre_save, sender=models.EmailEntry)\n', (150, 186), False, 'from django.dispatch import receiver\n'), ((531, 572), 'django.dispatch.receiver', 'receiver', (['pre_save'], {'sender': 'models.IPEntry'}), '(pre_save, se...
collaer/boardgames
app/boardgames/migrations/0001_initial.py
51dd9ec257e5d5bab23a88b10a5f91fdd7fe4210
# Generated by Django 3.1 on 2020-08-22 17:48 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='BoardGame', fields=[ ('id', models.AutoField(...
[((303, 396), 'django.db.models.AutoField', 'models.AutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (319, 396), False, 'from django.db import migrations, models\...
BlueRidgeLabs/slack-meetups
matcher/utils.py
aca850d4265f30f6d76bed1b1baeb2973c60c83d
import re # regex for a user or channel mention at the beginning of a message # example matches: " <@UJQ07L30Q> ", "<#C010P8N1ABB|interns>" # interactive playground: https://regex101.com/r/2Z7eun/2 MENTION_PATTERN = r"(?:^\s?<@(.*?)>\s?)|(?:^\s?<#(.*?)\|.*?>\s?)" def get_set_element(_set): """get the element fr...
[((1683, 1718), 're.search', 're.search', (['MENTION_PATTERN', 'message'], {}), '(MENTION_PATTERN, message)\n', (1692, 1718), False, 'import re\n'), ((2135, 2180), 're.sub', 're.sub', (['MENTION_PATTERN', '""""""', 'message'], {'count': '(1)'}), "(MENTION_PATTERN, '', message, count=1)\n", (2141, 2180), False, 'import ...
pantskun/swordiemen
scripts/quest/q3526s.py
fc33ffec168e6611587fdc75de8270f6827a4176
# In Search for the Lost Memory [Explorer Thief] (3526) # To be replaced with GMS's exact dialogue. # Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere): # https://kaengouraiu2.blog.fc2.com/blog-entry-46.html recoveredMemory = 7081 darkLord = 1052001 sm.setSpeakerID(...
[]
rummansadik/Admission-Automation
student/urls.py
a2fd305644cf60bfd0a381b855fb8c2810507f36
from django.contrib.auth.views import LoginView from django.urls import path from student import views urlpatterns = [ path('studentclick', views.studentclick_view, name='student-click'), path('studentlogin', LoginView.as_view( template_name='student/studentlogin.html'), name='studentlogin'), path...
[((125, 192), 'django.urls.path', 'path', (['"""studentclick"""', 'views.studentclick_view'], {'name': '"""student-click"""'}), "('studentclick', views.studentclick_view, name='student-click')\n", (129, 192), False, 'from django.urls import path\n'), ((316, 386), 'django.urls.path', 'path', (['"""studentsignup"""', 'vi...
lin-cp/aiida-quantumespresso
aiida_quantumespresso/parsers/neb.py
55f2bc8c137a69be24709a119bc285c700997907
# -*- coding: utf-8 -*- from aiida.common import NotExistent from aiida.orm import Dict from aiida_quantumespresso.calculations.pw import PwCalculation from aiida_quantumespresso.parsers import QEOutputParsingError from aiida_quantumespresso.parsers.parse_raw import convert_qe_to_aiida_structure from aiida_quantumespr...
[((8613, 8629), 'aiida.orm.TrajectoryData', 'TrajectoryData', ([], {}), '()\n', (8627, 8629), False, 'from aiida.orm import ArrayData, TrajectoryData\n'), ((10012, 10023), 'aiida.orm.ArrayData', 'ArrayData', ([], {}), '()\n', (10021, 10023), False, 'from aiida.orm import ArrayData, TrajectoryData\n'), ((2818, 2862), 'a...
Mindelirium/foundation
foundation/djangocms_submenu/cms_plugins.py
2d07e430915d696ca7376afea633692119c4d30e
from django.utils.translation import ugettext_lazy as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cms.models.pluginmodel import CMSPlugin class SubmenuPlugin(CMSPluginBase): model = CMSPlugin name = _("Submenu") render_template = "cms/plugins/submenu.html" pl...
[((318, 360), 'cms.plugin_pool.plugin_pool.register_plugin', 'plugin_pool.register_plugin', (['SubmenuPlugin'], {}), '(SubmenuPlugin)\n', (345, 360), False, 'from cms.plugin_pool import plugin_pool\n'), ((255, 267), 'django.utils.translation.ugettext_lazy', '_', (['"""Submenu"""'], {}), "('Submenu')\n", (256, 267), Tru...
thehardikv/ai-platform-samples
training/horovod/base/horovod_wrapper.py
0050d12476bcbfdb99d9894a3755a97da5cd80fe
import collections import datetime import json import multiprocessing import os import subprocess import sys import time _SSHD_BINARY_PATH = "/usr/sbin/sshd" EnvironmentConfig = collections.namedtuple( "EnvironmentConfig", ["hosts", "port", "is_chief", "pools", "job_id"]) class DeadlineExceededError(Excepti...
[((180, 277), 'collections.namedtuple', 'collections.namedtuple', (['"""EnvironmentConfig"""', "['hosts', 'port', 'is_chief', 'pools', 'job_id']"], {}), "('EnvironmentConfig', ['hosts', 'port', 'is_chief',\n 'pools', 'job_id'])\n", (202, 277), False, 'import collections\n'), ((651, 682), 'tensorflow.python.client.de...
shabaraba/SmaregiPy
smaregipy/pos/customer_groups.py
5447e5da1f21b38c0da1a759ee50b982de1522f7
import datetime from pydantic import Field from typing import ( ClassVar, List, Dict, Optional, ) from smaregipy.base_api import ( BaseServiceRecordApi, BaseServiceCollectionApi, ) from smaregipy.utils import NoData, DictUtil class CustomerGroup(BaseServiceRecordApi): RECORD_NAME = 'custo...
[((499, 528), 'pydantic.Field', 'Field', ([], {'default_factory': 'NoData'}), '(default_factory=NoData)\n', (504, 528), False, 'from pydantic import Field\n'), ((576, 605), 'pydantic.Field', 'Field', ([], {'default_factory': 'NoData'}), '(default_factory=NoData)\n', (581, 605), False, 'from pydantic import Field\n'), (...
JCab09/StickyDJ-Bot
StickyDJ-Bot/src/clients/client.py
feaf2229a6729be6ad022f9105da19192e3a91d3
#!/usr/bin/env python3 """ Base-Client Class This is the parent-class of all client-classes and holds properties and functions they all depend on. Author: Jason Cabezuela """ import src.util.debugger as Debugger import src.util.configmaker as configmaker class BaseClient(object): """Base-Client Class""" def ...
[((401, 429), 'src.util.debugger.Debugger', 'Debugger.Debugger', (['debugFlag'], {}), '(debugFlag)\n', (418, 429), True, 'import src.util.debugger as Debugger\n'), ((571, 616), 'src.util.configmaker.getConfig', 'configmaker.getConfig', (['configpath', 'configtype'], {}), '(configpath, configtype)\n', (592, 616), True, ...
S0L1DUS/cryptocoinmon
cryptomon/ascii.py
37b210ca2f93f0b70f160ad903782408dee0f9e9
# -*- coding: utf-8 -*- import sys from cryptomon.common import Colors if sys.version_info >= (3, 0): import io else: import StringIO as io ascii_title = """ /$$$$$$ /$$ /$$ /$$ /$$__ $$ | $$ ...
[((1247, 1265), 'StringIO.StringIO', 'io.StringIO', (['title'], {}), '(title)\n', (1258, 1265), True, 'import StringIO as io\n')]
Ishita-2001/Car-And-Pedestrian-prediction
car & pedestrian_tracker.py
6c4aeca84ae49d40ff6d27e51800c6f50db55070
import cv2 video=cv2.VideoCapture(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.mp4') #pre trained pedestrian and car classifier car_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\car.xml') pedestrian_tracker_file=(r'C:\Users\ISHITA\Desktop\ML project\UEM_PROJECT_COM\pedestrian.x...
[((18, 114), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""C:\\\\Users\\\\ISHITA\\\\Desktop\\\\ML project\\\\UEM_PROJECT_COM\\\\pedestrian.mp4"""'], {}), "(\n 'C:\\\\Users\\\\ISHITA\\\\Desktop\\\\ML project\\\\UEM_PROJECT_COM\\\\pedestrian.mp4')\n", (34, 114), False, 'import cv2\n'), ((374, 413), 'cv2.CascadeClassif...
glosoftgroup/tenants
saleor/wing/api/serializers.py
a6b229ad1f6d567b7078f83425a532830b71e1bb
# site settings rest api serializers from rest_framework import serializers from saleor.wing.models import Wing as Table class TableListSerializer(serializers.ModelSerializer): update_url = serializers.HyperlinkedIdentityField(view_name='wing:api-update') delete_url = serializers.HyperlinkedIdentityField(vie...
[((197, 262), 'rest_framework.serializers.HyperlinkedIdentityField', 'serializers.HyperlinkedIdentityField', ([], {'view_name': '"""wing:api-update"""'}), "(view_name='wing:api-update')\n", (233, 262), False, 'from rest_framework import serializers\n'), ((280, 345), 'rest_framework.serializers.HyperlinkedIdentityField'...
TheFamiliarScoot/open-toontown
toontown/fishing/FishCollection.py
678313033174ea7d08e5c2823bd7b473701ff547
from . import FishBase from . import FishGlobals class FishCollection: def __init__(self): self.fishList = [] def __len__(self): return len(self.fishList) def getFish(self): return self.fishList def makeFromNetLists(self, genusList, speciesList, weightList): self.fis...
[]
M4gicT0/Distribute
lead/strategies/strategy_base.py
af903cdf6ae271f4b1152007ea4ba3928af57936
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # # Distributed under terms of the MIT license. """ Strategy base class """ from abc import ABCMeta, abstractmethod from tinydb import TinyDB, Query from node import Node import json class Strategy(object): def __init__(self, this_controller, thi...
[((449, 470), 'tinydb.TinyDB', 'TinyDB', (['"""ledger.json"""'], {}), "('ledger.json')\n", (455, 470), False, 'from tinydb import TinyDB, Query\n'), ((489, 509), 'tinydb.TinyDB', 'TinyDB', (['"""nodes.json"""'], {}), "('nodes.json')\n", (495, 509), False, 'from tinydb import TinyDB, Query\n'), ((857, 915), 'node.Node',...
mudit-chopra/Python
project_euler/problem_01/sol6.py
5d186f16d1f6d497c95c28c0ced7134314f65168
''' Problem Statement: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3,5,6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below N. ''' from __future__ import print_function try: raw_input # Python 2 except NameError: raw_input = i...
[]
laymonage/django-jsonfallback
jsonfallback/functions.py
6e70edd2dbab7d74230e4af48d160ea8c6a663fb
import copy from django.db import NotSupportedError from django.db.models import Expression from .fields import mysql_compile_json_path, postgres_compile_json_path, FallbackJSONField class JSONExtract(Expression): def __init__(self, expression, *path, output_field=FallbackJSONField(), **extra): super()._...
[((1727, 1839), 'django.db.NotSupportedError', 'NotSupportedError', (['"""Functions on JSONFields are only supported on PostgreSQL and MySQL at the moment."""'], {}), "(\n 'Functions on JSONFields are only supported on PostgreSQL and MySQL at the moment.'\n )\n", (1744, 1839), False, 'from django.db import NotSup...
pmbaumgartner/excelify
excelify/tests.py
c0e29733efe407248810c3a8d3ec874f0cc0daca
import unittest import tempfile import pathlib import datetime import warnings from IPython.testing.globalipapp import start_ipython, get_ipython import pandas.util.testing as tm from pandas.core.frame import DataFrame from pandas.core.series import Series from pandas import read_excel import pytest ip = get_ipytho...
[((310, 323), 'IPython.testing.globalipapp.get_ipython', 'get_ipython', ([], {}), '()\n', (321, 323), False, 'from IPython.testing.globalipapp import start_ipython, get_ipython\n'), ((4574, 4582), 'pandas.core.series.Series', 'Series', ([], {}), '()\n', (4580, 4582), False, 'from pandas.core.series import Series\n'), (...
lw7360/dailyprogrammer
Easy/233/233.py
7a0a4bdf20dd22ca96713958b479d963a15b09f5
# https://www.reddit.com/r/dailyprogrammer/comments/3ltee2/20150921_challenge_233_easy_the_house_that_ascii/ import random import sys def main(): data = open(sys.argv[1]).read().splitlines()[1::] door = random.randrange(len(data[-1])) wideData = [] for row in data: curStr = '' for...
[]
uwitec/LEHome
usr/callbacks/action/tools.py
a959a2fe64a23c58de7c0ff3254eae8c27732320
#!/usr/bin/env python # encoding: utf-8 from __future__ import division from decimal import Decimal import subprocess import threading import urllib2 import urllib import httplib import json import re import hashlib import base64 # import zlib from lib.command.runtime import UserInput from lib.helper.CameraHelper ...
[]
Athenian-Computer-Science/numeric-operations-1-practice-template
src/fix_code_1.py
cdfe370ced98c5e4c770bb89bb7faf0da31ea985
############################# # Collaborators: (enter people or resources who/that helped you) # If none, write none # # ############################# base = input('Enter the base: ") height = area = # Calculate the area of the triangle print("The area of the triangle is (area).")
[]
gmazzamuto/gputools
gputools/core/oclmultireduction.py
73a4dee76a119f94d8163781a85b691fd080d506
""" an adaptation of pyopencl's reduction kernel for weighted avarages like sum(a*b) mweigert@mpi-cbg.de """ from __future__ import print_function, unicode_literals, absolute_import, division from six.moves import zip import pyopencl as cl from pyopencl.tools import ( context_dependent_memoize, dtype_to_cty...
[((5967, 5994), 'pyopencl.Program', 'cl.Program', (['ctx', 'inf.source'], {}), '(ctx, inf.source)\n', (5977, 5994), True, 'import pyopencl as cl\n'), ((11888, 12003), 'gputools.OCLReductionKernel', 'OCLReductionKernel', (['np.float32'], {'neutral': '"""0"""', 'reduce_expr': '"""a+b"""', 'map_expr': '"""x[i]"""', 'argum...
DidymusRex/PiCraft
mineshaft.py
07b7dad2e68a2473e4314c9b77cb82abce41ae97
#! /usr/bin/env python import mcpi.minecraft as minecraft import mcpi.block as block import random import time mc = minecraft.Minecraft.create() # ---------------------------------------------------------------------- # S E T U P # ---------------------------------------------------------------------- # Where Am ...
[]
ChenglongChen/TextRank4ZH
example/example01.py
5af7b9d33d9e686411576362dfccf6f9d3d3282b
#-*- encoding:utf-8 -*- from __future__ import print_function import sys try: reload(sys) sys.setdefaultencoding('utf-8') except: pass import codecs from textrank4zh import TextRank4Keyword, TextRank4Sentence text = codecs.open('../test/doc/01.txt', 'r', 'utf-8').read() tr4w = TextRank4Keyword() tr4w.an...
[((293, 311), 'textrank4zh.TextRank4Keyword', 'TextRank4Keyword', ([], {}), '()\n', (309, 311), False, 'from textrank4zh import TextRank4Keyword, TextRank4Sentence\n'), ((647, 666), 'textrank4zh.TextRank4Sentence', 'TextRank4Sentence', ([], {}), '()\n', (664, 666), False, 'from textrank4zh import TextRank4Keyword, Text...
suutari-ai/respa
scripts/anonymize_dumpdata.py
a944b1c13f855eaf5f883687b5fd025ece7c8176
import random import uuid import sys import json from faker import Factory from faker.providers.person.fi_FI import Provider as PersonProvider fake = Factory.create('fi_FI') email_by_user = {} users_by_id = {} def anonymize_users(users): usernames = set() emails = set() for data in users: if data...
[((151, 174), 'faker.Factory.create', 'Factory.create', (['"""fi_FI"""'], {}), "('fi_FI')\n", (165, 174), False, 'from faker import Factory\n'), ((1731, 1751), 'json.load', 'json.load', (['sys.stdin'], {}), '(sys.stdin)\n', (1740, 1751), False, 'import json\n'), ((1795, 1832), 'json.dump', 'json.dump', (['data', 'sys.s...
NucciTheBoss/pytorch_geometric
torch_geometric/utils/negative_sampling.py
e220a2c08fa1b2f1672d616c22eac2a67b5c8967
import random from typing import Optional, Tuple, Union import numpy as np import torch from torch import Tensor from torch_geometric.utils import coalesce, degree, remove_self_loops from .num_nodes import maybe_num_nodes def negative_sampling(edge_index: Tensor, num_nodes: Optional[Union[int...
[((5711, 5748), 'torch.split', 'torch.split', (['edge_index', 'split'], {'dim': '(1)'}), '(edge_index, split, dim=1)\n', (5722, 5748), False, 'import torch\n'), ((5764, 5799), 'torch_geometric.utils.degree', 'degree', (['src_batch'], {'dtype': 'torch.long'}), '(src_batch, dtype=torch.long)\n', (5770, 5799), False, 'fro...
DavidJohnKelly/YoutubeDownloader
venv/Lib/site-packages/pafy/g.py
29cb4aa90946803474959f60d7b7e2f07c6e4de2
import sys if sys.version_info[:2] >= (3, 0): # pylint: disable=E0611,F0401,I0011 from urllib.request import build_opener else: from urllib2 import build_opener from . import __version__ urls = { 'gdata': "https://www.googleapis.com/youtube/v3/", 'watchv': "http://www.youtube.com/watch?v=%s", ...
[((940, 954), 'urllib2.build_opener', 'build_opener', ([], {}), '()\n', (952, 954), False, 'from urllib2 import build_opener\n')]
uwacyber/cowrie
src/cowrie/telnet/userauth.py
1d81e1ca5d0b8461e06f17aee26cb7bf108a16e5
# Copyright (C) 2015, 2016 GoSecure Inc. """ Telnet Transport and Authentication for the Honeypot @author: Olivier Bilodeau <obilodeau@gosecure.ca> """ from __future__ import annotations import struct from twisted.conch.telnet import ( ECHO, LINEMODE, NAWS, SGA, AuthenticatingTelnetProtocol, ...
[((1410, 1467), 'twisted.conch.telnet.AuthenticatingTelnetProtocol.connectionLost', 'AuthenticatingTelnetProtocol.connectionLost', (['self', 'reason'], {}), '(self, reason)\n', (1453, 1467), False, 'from twisted.conch.telnet import ECHO, LINEMODE, NAWS, SGA, AuthenticatingTelnetProtocol, ITelnetProtocol\n'), ((2208, 22...
flyr4nk/secscan-authcheck
authcheck/app/model/exception.py
d04c6ae3dc1fa7841727d23161c27eebaf92be3c
class WebException(Exception): pass class ParserException(Exception): """ 解析异常 """ pass class ApiException(Exception): """ api异常 """ pass class WsException(Exception): """ 轮询异常 """ pass class SsoException(Exception): """ sso异...
[]
JeremyBuchanan/psf-photometry-pipeline
p_io.py
864818dc8dd946a6e4d8dde1667bf948b769bb39
import astropy.io.fits as fits import matplotlib import matplotlib.pyplot as plt import numpy as np import obj_data as od import saphires as saph from astropy.time import Time from astropy.visualization import ZScaleInterval, SqrtStretch, ImageNormalize from matplotlib.backends.backend_pdf import PdfPages ra = od.ra d...
[((395, 440), 'matplotlib.rcParams.update', 'matplotlib.rcParams.update', (["{'font.size': 12}"], {}), "({'font.size': 12})\n", (421, 440), False, 'import matplotlib\n'), ((1309, 1325), 'numpy.mean', 'np.mean', (['airmass'], {}), '(airmass)\n', (1316, 1325), True, 'import numpy as np\n'), ((1747, 1854), 'saphires.utils...
ichuang/sympy
sympy/polys/tests/test_monomialtools.py
18afbcc7df2ebf2280ea5a88fde8ece34182ae71
"""Tests for tools and arithmetics for monomials of distributed polynomials. """ from sympy.polys.monomialtools import ( monomials, monomial_count, monomial_key, lex, grlex, grevlex, monomial_mul, monomial_div, monomial_gcd, monomial_lcm, monomial_max, monomial_min, monomial_divides, Monomi...
[((2975, 2992), 'sympy.polys.monomialtools.InverseOrder', 'InverseOrder', (['lex'], {}), '(lex)\n', (2987, 2992), False, 'from sympy.polys.monomialtools import monomials, monomial_count, monomial_key, lex, grlex, grevlex, monomial_mul, monomial_div, monomial_gcd, monomial_lcm, monomial_max, monomial_min, monomial_divid...
johnbilliris/Azure-Sentinel
Solutions/TenableIO/Data Connectors/azure_sentinel.py
ef3c2e3919023e80e15a94544e06e37623e7c1d3
import re import base64 import hmac import hashlib import logging import requests from datetime import datetime class AzureSentinel: def __init__(self, workspace_id, workspace_key, log_type, log_analytics_url=''): self._workspace_id = workspace_id self._workspace_key = workspace_key self....
[((1128, 1165), 'base64.b64decode', 'base64.b64decode', (['self._workspace_key'], {}), '(self._workspace_key)\n', (1144, 1165), False, 'import base64\n'), ((1466, 1526), 'logging.info', 'logging.info', (['"""constructing post to send to Azure Sentinel."""'], {}), "('constructing post to send to Azure Sentinel.')\n", (1...
siddharths067/CNN-Based-Agent-Modelling-for-Humanlike-Driving-Simulaion
MiniProject.py
42d79fc262d60ecc9eebbe0e77a1576a04979501
from tkinter import * from PIL import ImageGrab import numpy as np import cv2 import time import pyautogui as pg import DirectInputRoutines as DIR from LogKey import key_check last_time = time.time() one_hot = [0, 0, 0, 0, 0, 0] hash_dict = {'w':0, 's':1, 'a':2, 'd':3, 'c':4, 'v':5} X = [] y = [] def a...
[((196, 207), 'time.time', 'time.time', ([], {}), '()\n', (205, 207), False, 'import time\n'), ((3513, 3532), 'numpy.save', 'np.save', (['"""X.npy"""', 'X'], {}), "('X.npy', X)\n", (3520, 3532), True, 'import numpy as np\n'), ((3534, 3553), 'numpy.save', 'np.save', (['"""y.npy"""', 'y'], {}), "('y.npy', y)\n", (3541, 3...
jielyu/notebook
src/code/djangotest/migrations/0001_initial.py
d0c0d0306fdb2746195c9d7851af25d0393a311d
# Generated by Django 2.2.5 on 2019-10-05 23:22 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Password', fields=[ ('id', models.IntegerFi...
[((304, 371), 'django.db.models.IntegerField', 'models.IntegerField', ([], {'primary_key': '(True)', 'serialize': '(False)', 'unique': '(True)'}), '(primary_key=True, serialize=False, unique=True)\n', (323, 371), False, 'from django.db import migrations, models\n'), ((402, 434), 'django.db.models.CharField', 'models.Ch...
pbs/django-filer
filer/tests/utils/__init__.py
c862a84d4e1d86c14eeb509e341f6a7d39a421bf
from django.template.loaders.base import Loader as BaseLoader from django.template.base import TemplateDoesNotExist class Mock(): pass class MockLoader(BaseLoader): is_usable = True def load_template_source(self, template_name, template_dirs=None): if template_name == 'cms_mock_template.html':...
[((492, 514), 'django.template.base.TemplateDoesNotExist', 'TemplateDoesNotExist', ([], {}), '()\n', (512, 514), False, 'from django.template.base import TemplateDoesNotExist\n')]
davmre/sigvisa
utils/arrival_overlaps.py
91a1f163b8f3a258dfb78d88a07f2a11da41bd04
import sigvisa.database.db from sigvisa.database.dataset import * import sigvisa.utils.geog cursor = database.db.connect().cursor() detections, arid2num = read_detections(cursor, 1237680000, 1237680000 + 168 * 3600, arrival_table="leb_arrival", noarrays=False) last_det = dict() overlaps = 0 for det in detections: ...
[]
mmrahorovic/finn
tests/transformation/streamline/test_move_identical_op_past_join_op.py
d1cc9cf94f1c33354cc169c5a6517314d0e94e3b
import pytest from onnx import TensorProto from onnx import helper as oh import finn.core.onnx_exec as oxe from finn.core.modelwrapper import ModelWrapper from finn.transformation.streamline.reorder import MoveTransposePastJoinAdd from finn.util.basic import gen_finn_dt_tensor def create_model(perm): if perm ==...
[((1846, 1907), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""perm"""', '[[0, 3, 1, 2], [0, 2, 3, 1]]'], {}), "('perm', [[0, 3, 1, 2], [0, 2, 3, 1]])\n", (1869, 1907), False, 'import pytest\n'), ((533, 628), 'onnx.helper.make_node', 'oh.make_node', (['"""Transpose"""'], {'inputs': "['in_transpose1']", 'ou...
jchrisfarris/antiope-scorecards
app/lib/ncr_util.py
82a1e228f4bd23f756c1dec8c0582fcde98de564
import json from lib import authz from lib.logger import logger from lib.exclusions import exclusions, state_machine def get_allowed_actions(user, account_id, requirement, exclusion): allowed_actions = { 'remediate': False, 'requestExclusion': False, 'requestExclusionChange': False, }...
[((341, 372), 'lib.exclusions.exclusions.get_state', 'exclusions.get_state', (['exclusion'], {}), '(exclusion)\n', (361, 372), False, 'from lib.exclusions import exclusions, state_machine\n'), ((474, 522), 'lib.logger.logger.debug', 'logger.debug', (['"""Current state: %s"""', 'current_state'], {}), "('Current state: %...
Syndra/Ambari-source
ambari-server/src/test/python/stacks/2.6/SPARK2/test_spark_livy2.py
717526b2bf3636622212b14de0d3d298a20c7370
#!/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License")...
[]
harimaruthachalam/SentDexChapters
SentDex/Chapter05.py
b3753ae27b6f965f3611edea9bde2ed5e9478f8f
import quandl import math import numpy as np from sklearn import preprocessing, cross_validation, svm from sklearn.linear_model import LinearRegression import pickle import datetime from matplotlib import style import matplotlib.pyplot as plot # Config isLoadFromLocal = True quandl.ApiConfig.api_key = '76eCnz6z9XTH8nf...
[((327, 346), 'matplotlib.style.use', 'style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (336, 346), False, 'from matplotlib import style\n'), ((1087, 1109), 'sklearn.preprocessing.scale', 'preprocessing.scale', (['x'], {}), '(x)\n', (1106, 1109), False, 'from sklearn import preprocessing, cross_validation, svm\n'), ...
pmay/tifinity
tifinity/actions/icc_parser.py
e004a0e616c7b7455fac6f01ee9acb892cd560c0
class IccProfile(): """Parses an ICC Colour Profile. According to spec: all Profile data shall be encoded as big-endian""" def __init__(self, bytes): self.header = {} self.parse_icc(bytes) def get_colour_space(self): """Returns the data colour space type, or None if not defi...
[((7723, 7755), 'numpy.fromfile', 'np.fromfile', (['file'], {'dtype': '"""uint8"""'}), "(file, dtype='uint8')\n", (7734, 7755), True, 'import numpy as np\n')]
asakatida/data-structures-and-algorithms.py
challenges/binary_search/test_binary_search.py
587d1a66a6c15a3c7d7786275608f065687e1810
from .binary_search import binary_search def test_binary_search_empty_array(): assert binary_search([], 0) == -1 def test_binary_search_find_single_array(): assert binary_search([3], 3) == 0 def test_binary_search_not_found_single_array(): assert binary_search([1], 0) == -1 def test_binary_search_no...
[]
Cipalex/session3
Module2.py
fe0866db54d719687f5a89a71ddc17657c91089e
def f(): print('f from module 2') if __name__ == '__main__': print('Module 2')
[]