repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
garlicbutter/Jonathan-Tom
mojoco trivial/mujocoSim/UR5/simple_example/Mujoco_py_example.py
c1696f0a94da46911b3566a3d4f49791e877373f
import numpy as np import mujoco_py as mj from mujoco_py_renderer import SimulationError, XMLError, MujocoPyRenderer from mujoco_py import (MjSim, load_model_from_xml,functions, load_model_from_path, MjSimState, ignore_mujoco_warnings, load_model_from...
[((2031, 2055), 'mujoco_py.load_model_from_xml', 'load_model_from_xml', (['xml'], {}), '(xml)\n', (2050, 2055), False, 'from mujoco_py import MjSim, load_model_from_xml, functions, load_model_from_path, MjSimState, ignore_mujoco_warnings, load_model_from_mjb\n'), ((2063, 2075), 'mujoco_py.MjSim', 'MjSim', (['model'], {...
seveirbian/gear-old
evaluation/wordpress/pull_docker_images_from_private_registry.py
8d3529a9bf42e652a9d7475c9d14e9a6afc69a76
import sys # package need to be installed, pip install docker import docker import time import yaml import os import xlwt auto = False private_registry = "202.114.10.146:9999/" # result result = [["tag", "finishTime", "size", "data"], ] class Puller: def __init__(self, images): self.images_to_pull =...
[]
sibeshkar/jiminy
jiminy/envs/vnc_wog.py
7754f86fb0f246e7d039ea0cbfd9950fcae4adfb
from jiminy.envs import vnc_env from jiminy.spaces import VNCActionSpace class WorldOfGooEnv(vnc_env.VNCEnv): def __init__(self): super(WorldOfGooEnv, self).__init__() # TODO: set action space screen shape to match # HACK: empty keys list fails for some weird reason, give it an 'a' ...
[((341, 384), 'jiminy.spaces.VNCActionSpace', 'VNCActionSpace', ([], {'keys': "['a']", 'buttonmasks': '[1]'}), "(keys=['a'], buttonmasks=[1])\n", (355, 384), False, 'from jiminy.spaces import VNCActionSpace\n')]
arj119/FedML
fedml_api/standalone/federated_sgan/fedssgan_api.py
5b7c098659f3e61f9e44583965300d8d0829f7a8
import copy import logging import random from typing import List, Tuple import numpy as np import torch import wandb from torch.utils.data import ConcatDataset from fedml_api.standalone.fedavg.my_model_trainer import MyModelTrainer from fedml_api.standalone.federated_sgan.ac_gan_model_trainer import ACGANModelTrainer...
[((1127, 1156), 'fedml_api.standalone.fedavg.my_model_trainer.MyModelTrainer', 'MyModelTrainer', (['adapter_model'], {}), '(adapter_model)\n', (1141, 1156), False, 'from fedml_api.standalone.fedavg.my_model_trainer import MyModelTrainer\n'), ((1521, 1583), 'logging.info', 'logging.info', (['"""############setup_clients...
arjun-sai-krishnan/tamil-morpho-embeddings
pytorch-word2vec-master/csv.py
a33bcb427d635dba3b1857f26ea7ab287e1a44c5
#!/usr/bin/env python3 import argparse from collections import Counter import pdb import pickle import re import sys import time import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from torch import optim import torch.nn.functional as F import torch.multiprocessing as mp import ...
[((390, 415), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (413, 415), False, 'import argparse\n'), ((2370, 2379), 'collections.Counter', 'Counter', ([], {}), '()\n', (2377, 2379), False, 'from collections import Counter\n'), ((6620, 6640), 'torch.load', 'torch.load', (['filename'], {}), '(fi...
ProEgitim/Python-Dersleri-BEM
Ogrenciler/Varol/buyuksayi.py
b25e9fdb1fa3026925a46b2fcbcba348726b775c
sayi1 = int(input("1. Sayı: ")) sayi2 = int(input("2. Sayı: ")) sayi3 = int(input("3. Sayı: ")) sayi4 = int(input("4. Sayı: ")) sayi5 = int(input("5. Sayı: ")) sayilar=[]; sayilar.append(sayi1) sayilar.append(sayi2) sayilar.append(sayi3) sayilar.append(sayi4) sayilar.append(sayi5) sayilar.sort() print("En büyük sayimiz...
[]
MouseHu/emdqn
baselines/deepq/build_graph_mfec.py
ba907e959f21dd0b5a17117accccae9c82a79a3b
"""Deep Q learning graph The functions in this file can are used to create the following functions: ======= act ======== Function to chose an action given an observation Parameters ---------- observation: object Observation that can be feed into the output of make_obs_ph stochastic: bool...
[((5243, 5307), 'tensorflow.placeholder', 'tf.placeholder', (['tf.float32', '[None, latent_dim]'], {'name': '"""act_noise"""'}), "(tf.float32, [None, latent_dim], name='act_noise')\n", (5257, 5307), True, 'import tensorflow as tf\n'), ((2438, 2475), 'tensorflow.variable_scope', 'tf.variable_scope', (['scope'], {'reuse'...
frodre/LMR
tests/test_prior.py
4c00d3f9db96447e69bd3f426d59524f7b5f3ef5
import sys sys.path.append('../') import LMR_config as cfg import LMR_prior import numpy as np import pytest def test_prior_seed(): cfg_obj = cfg.Config(**{'core':{'seed': 2}}) prior_cfg = cfg_obj.prior prior_source = '20cr' datadir_prior = 'data' datafile_prior = '[vardef_template]_gridded_dat....
[((12, 34), 'sys.path.append', 'sys.path.append', (['"""../"""'], {}), "('../')\n", (27, 34), False, 'import sys\n'), ((150, 185), 'LMR_config.Config', 'cfg.Config', ([], {}), "(**{'core': {'seed': 2}})\n", (160, 185), True, 'import LMR_config as cfg\n'), ((395, 435), 'LMR_prior.prior_assignment', 'LMR_prior.prior_assi...
juanjo3ns/SalGAN2
src/salgan_dhf1k/train_bce.py
ac52af743b94961cdb44c5d89774b72fc8acfd3e
import os from dataloader.datasetDHF1K import DHF1K from torch.utils.data import DataLoader from utils.salgan_utils import save_model, get_lr_optimizer from utils.sendTelegram import send from utils.printer import param_print from utils.salgan_generator import create_model, add_bn from evaluation.fast_evaluation impor...
[((2215, 2234), 'numpy.mean', 'np.mean', (['total_loss'], {}), '(total_loss)\n', (2222, 2234), True, 'import numpy as np\n'), ((2311, 2336), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (2334, 2336), False, 'import argparse\n'), ((4025, 4110), 'dataloader.datasetDHF1K.DHF1K', 'DHF1K', ([], {'...
tracon/dragontail
dragontail/content/models/basicpage.py
aae860acb5fe400015557f659b6d4221b939747a
# encoding: utf-8 from django.db import models from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.fields import StreamField from wagtail.wagtailcore import blocks from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel from wagtail.wagtailimages.blocks import ImageChooserBlock ...
[((518, 542), 'wagtail.wagtailadmin.edit_handlers.StreamFieldPanel', 'StreamFieldPanel', (['"""body"""'], {}), "('body')\n", (534, 542), False, 'from wagtail.wagtailadmin.edit_handlers import FieldPanel, StreamFieldPanel\n'), ((392, 414), 'wagtail.wagtailcore.blocks.RichTextBlock', 'blocks.RichTextBlock', ([], {}), '()...
infapy/infapy
infapy/v3/agentService.py
0cb11310130be70ce1b647aa5ede929c1eb9b2ce
# Copyright (c) 2021-Present (Prashanth Pradeep) # 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 agreed...
[((1249, 1297), 'infapy.log.info', 'infapy.log.info', (["('agentService API URL - ' + url)"], {}), "('agentService API URL - ' + url)\n", (1264, 1297), False, 'import infapy\n'), ((1974, 2006), 'infapy.log.info', 'infapy.log.info', (["data['message']"], {}), "(data['message'])\n", (1989, 2006), False, 'import infapy\n'...
pengwow/test-demo
home_application/views.py
9d5c460b534d93d84f39ae24db82aa101027d199
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云(BlueKing) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obt...
[((1175, 1205), 'blueking.component.shortcuts.get_client_by_request', 'get_client_by_request', (['request'], {}), '(request)\n', (1196, 1205), False, 'from blueking.component.shortcuts import get_client_by_request\n'), ((1333, 1428), 'common.mymako.render_mako_context', 'render_mako_context', (['request', '"""/home_app...
moseskim/Expert-Python-Programming-Fourth-Edition
Chapter 6/09 - The built-in multiprocessing module/basic_multiprocessing.py
5160f974deb2365597b7be9cc032f24bfa13471a
""" "멀티프로세싱"절 예시 `multiprocessing` 모듈을 이용해 새로운 프로세스들을 생성하는 방법을 설명한다. """ from multiprocessing import Process import os def work(identifier): print(f'Hey, I am the process ' f'{identifier}, pid: {os.getpid()}') def main(): processes = [Process(target=work, args=(number,)) for number in range(5)] for proc...
[((247, 283), 'multiprocessing.Process', 'Process', ([], {'target': 'work', 'args': '(number,)'}), '(target=work, args=(number,))\n', (254, 283), False, 'from multiprocessing import Process\n'), ((154, 165), 'os.getpid', 'os.getpid', ([], {}), '()\n', (163, 165), False, 'import os\n')]
dominoFire/sweeper
sweeper/cloud/localhost/manager.py
26c5497b81c8d0c50671f8ab75c1cf5c4c8191c9
__author__ = '@dominofire' import os from sweeper.cloud import resource_config_combinations from sweeper.cloud.localhost import resource_config_factory as config_factory from sweeper.resource import Resource def possible_configs(num): configs = config_factory.list_configs() combs = resource_config_combinati...
[((253, 282), 'sweeper.cloud.localhost.resource_config_factory.list_configs', 'config_factory.list_configs', ([], {}), '()\n', (280, 282), True, 'from sweeper.cloud.localhost import resource_config_factory as config_factory\n'), ((295, 337), 'sweeper.cloud.resource_config_combinations', 'resource_config_combinations', ...
BACtaki/tfx
tfx/orchestration/experimental/core/service_jobs_test.py
29db845200beccbb0ffa1e1e1a091e314a3a470f
# Copyright 2021 Google LLC. 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
[((3178, 3192), 'tensorflow.test.main', 'tf.test.main', ([], {}), '()\n', (3190, 3192), True, 'import tensorflow as tf\n'), ((998, 1065), 'absl.testing.absltest.mock.create_autospec', 'mock.create_autospec', (['service_jobs.ServiceJobManager'], {'instance': '(True)'}), '(service_jobs.ServiceJobManager, instance=True)\n...
kundajelab/dragonn
dragonn/models.py
431e7c6b94a82972ac0fc3ef76d76e9ce8ba67fc
from __future__ import absolute_import, division, print_function import matplotlib import numpy as np import os import subprocess import sys import tempfile matplotlib.use('pdf') import matplotlib.pyplot as plt from abc import abstractmethod, ABCMeta from dragonn.metrics import ClassificationResult from sklearn.svm imp...
[((157, 178), 'matplotlib.use', 'matplotlib.use', (['"""pdf"""'], {}), "('pdf')\n", (171, 178), False, 'import matplotlib\n'), ((592, 625), 'warnings.filterwarnings', 'warnings.filterwarnings', (['"""ignore"""'], {}), "('ignore')\n", (615, 625), False, 'import warnings\n'), ((1169, 1224), 'keras.models.load_model', 'lo...
haltu/velmu-mpass-demo
src/mpass/mpass/migrations/0001_initial.py
19eb0e14fa6710e4aee5d47c898cf570bf7621e5
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-20 08:34 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import parler.models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
[((3452, 3516), 'django.db.models.ManyToManyField', 'models.ManyToManyField', ([], {'blank': '(True)', 'to': '"""mpass.AuthenticationTag"""'}), "(blank=True, to='mpass.AuthenticationTag')\n", (3474, 3516), False, 'from django.db import migrations, models\n'), ((436, 529), 'django.db.models.AutoField', 'models.AutoField...
fractalego/dgt
dgt/inference/forward_inference.py
6781b9445d93c4a1680ab3d5636803c81062cc67
import logging import random from dgt.graph.graph_matcher import GraphWeightedMatch from dgt.utils import graph_iterations _logger = logging.getLogger(__name__) def find_weight_between(s, first, last): try: start = s.index(first) + len(first) end = s.index(last, start) return s[start:end...
[((135, 162), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (152, 162), False, 'import logging\n'), ((2049, 2073), 'dgt.utils.graph_iterations', 'graph_iterations', (['drs._g'], {}), '(drs._g)\n', (2065, 2073), False, 'from dgt.utils import graph_iterations\n')]
ikekilinc/dnnSuperBinoculars
serverPythonClient/client.py
b0fc584b1d449961bdbab37cf9d72c0b466f197f
import argparse import cv2 import common # from .utils.cropAtCenter import cropImageCenter # from cropAtCenter import cropImageCenter from gabriel_client.websocket_client import WebsocketClient from gabriel_client.opencv_adapter import OpencvAdapter DEFAULT_SERVER_HOST = '128.2.212.50' DEFAULT_ZOOM_FACTOR = 10 def ...
[((819, 857), 'cv2.imshow', 'cv2.imshow', (['"""Image from server"""', 'frame'], {}), "('Image from server', frame)\n", (829, 857), False, 'import cv2\n'), ((862, 876), 'cv2.waitKey', 'cv2.waitKey', (['(1)'], {}), '(1)\n', (873, 876), False, 'import cv2\n'), ((895, 921), 'common.configure_logging', 'common.configure_lo...
SharsDela/BankCardRecognize
src/DeepCard.API/batch.py
ce80589bc5a5afaba2b97b1ccab35354fb99b548
from api import get_result import os import shutil from glob import glob from PIL import Image if __name__ == '__main__': image_files = glob('./test_images/*.*') result_dir = './test_results' if os.path.exists(result_dir): shutil.rmtree(result_dir) os.mkdir(result_dir) txt_file = os.path.j...
[((141, 166), 'glob.glob', 'glob', (['"""./test_images/*.*"""'], {}), "('./test_images/*.*')\n", (145, 166), False, 'from glob import glob\n'), ((208, 234), 'os.path.exists', 'os.path.exists', (['result_dir'], {}), '(result_dir)\n', (222, 234), False, 'import os\n'), ((274, 294), 'os.mkdir', 'os.mkdir', (['result_dir']...
MaximeBaudette/PyCIM
CIM14/ENTSOE/Equipment/Core/Curve.py
d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14
# Copyright (C) 2010-2011 Richard Lincoln # # 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, modify, merge, publish...
[]
unclenachoduh/python-fluent
fluent/syntax/errors.py
1d15bdc94a37ecb488a80aefcdd37b8cb5535f73
from __future__ import unicode_literals class ParseError(Exception): def __init__(self, code, *args): self.code = code self.args = args self.message = get_error_message(code, args) def get_error_message(code, args): if code == 'E00001': return 'Generic error' if code == '...
[]
jdddog/mag-archiver
tests/test_mag.py
079e735e610d6b81b3ac8dc479d4f93bb0aacb11
# Copyright 2020 Curtin University # # 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 agreed to in writi...
[((5771, 5800), 'pendulum.datetime', 'pendulum.datetime', (['(1601)', '(1)', '(1)'], {}), '(1601, 1, 1)\n', (5788, 5800), False, 'import pendulum\n'), ((5971, 6021), 'pendulum.datetime', 'pendulum.datetime', ([], {'year': 'year', 'month': 'month', 'day': 'day'}), '(year=year, month=month, day=day)\n', (5988, 6021), Fal...
jacob-heglund/socialsensing-jh
twitterinfrastructure/CH-Data-Public.py
fd6d2d749f40fee46bee749ff868212bf117a747
''' Created on Mar 22, 2018 Edited on Jan 11, 2019 @author: npvance2 @author: curtisd2 Variables that will need to be edited/personalized: monitorID in Variables() (line 27) projectStartDate in Variables() (line 28) projectEndDate in Variables() (line 29) authToken in getAuthToken() (...
[((2285, 2328), 'tweepy.OAuthHandler', 'OAuthHandler', (['consumer_key', 'consumer_secret'], {}), '(consumer_key, consumer_secret)\n', (2297, 2328), False, 'from tweepy import OAuthHandler\n'), ((2394, 2467), 'tweepy.API', 'tweepy.API', (['auth'], {'wait_on_rate_limit': '(True)', 'wait_on_rate_limit_notify': '(True)'})...
danhnguyen48/slurm-elastic-computing
roles/slurm/files/startnode.py
0793cf23677169a6d9dceea0793118bc00c0913e
#! /opt/cloud_sdk/bin/python import asyncio import logging import subprocess import sys import citc_cloud def handle_exception(exc_type, exc_value, exc_traceback): if issubclass(exc_type, KeyboardInterrupt): sys.__excepthook__(exc_type, exc_value, exc_traceback) return log.critical("Uncaugh...
[((425, 451), 'citc_cloud.get_nodespace', 'citc_cloud.get_nodespace', ([], {}), '()\n', (449, 451), False, 'import citc_cloud\n'), ((887, 917), 'logging.getLogger', 'logging.getLogger', (['"""startnode"""'], {}), "('startnode')\n", (904, 917), False, 'import logging\n'), ((963, 1012), 'logging.FileHandler', 'logging.Fi...
BryanRiel/pyre
tests/pyre/components/component_class_registration_model.py
179359634a7091979cced427b6133dd0ec4726ea
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # michael a.g. aïvázis # orthologue # (c) 1998-2018 all rights reserved # """ Verify that component registration interacts correctly with the pyre configurator model """ # access # print(" -- importing pyre") import pyre # print(" -- done") def declare(): # dec...
[((430, 451), 'pyre.properties.str', 'pyre.properties.str', ([], {}), '()\n', (449, 451), False, 'import pyre\n'), ((465, 486), 'pyre.properties.str', 'pyre.properties.str', ([], {}), '()\n', (484, 486), False, 'import pyre\n'), ((732, 765), 'pyre.properties.str', 'pyre.properties.str', ([], {'default': '"""p1"""'}), "...
carlmontanari/nssh
tests/unit/transport/plugins/asyncssh/test_asyncssh_transport.py
fa2277ea0b8fdb81de3064e1d48bad9264f0cd64
import asyncio from io import BytesIO import pytest from asyncssh.connection import SSHClientConnection from asyncssh.stream import SSHReader from scrapli.exceptions import ScrapliConnectionNotOpened, ScrapliTimeout class DumbContainer: def __init__(self): self.preferred_auth = () def __getattr__(s...
[((3113, 3130), 'asyncssh.stream.SSHReader', 'SSHReader', (['""""""', '""""""'], {}), "('', '')\n", (3122, 3130), False, 'from asyncssh.stream import SSHReader\n'), ((3683, 3700), 'asyncssh.stream.SSHReader', 'SSHReader', (['""""""', '""""""'], {}), "('', '')\n", (3692, 3700), False, 'from asyncssh.stream import SSHRea...
Mozilla-GitHub-Standards/93f18f14efcf5fdfc0e04f9bf247f66baf46663f37b1d2087ab8d850abc90803
apps/ignite/views.py
4e374b4d52dfb9039ebe543e7f27682189022307
from django.shortcuts import get_object_or_404 import jingo import waffle from django.contrib.auth.models import User from challenges.models import Submission, Category from projects.models import Project from blogs.models import BlogEntry from events.models import Event def splash(request, project, slug, template_n...
[((409, 449), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['Project'], {'slug': 'project'}), '(Project, slug=project)\n', (426, 449), False, 'from django.shortcuts import get_object_or_404\n'), ((466, 517), 'django.shortcuts.get_object_or_404', 'get_object_or_404', (['project.challenge_set'], {'slug': '...
thebouv/IUS-Hacktoberfest
dataPresenter.py
084634ec2feff3e81862d85b3938e1ae2c5aadff
from plotly.subplots import make_subplots import plotly.graph_objects as go import plotly.io as pio from dataProcessor import parseLabels, parseLangs import plotly.io as pio import os years = parseLabels() langs = parseLangs() #make the plotly results fig = make_subplots( rows=1, cols=2, specs=[[{"type": "x...
[((194, 207), 'dataProcessor.parseLabels', 'parseLabels', ([], {}), '()\n', (205, 207), False, 'from dataProcessor import parseLabels, parseLangs\n'), ((216, 228), 'dataProcessor.parseLangs', 'parseLangs', ([], {}), '()\n', (226, 228), False, 'from dataProcessor import parseLabels, parseLangs\n'), ((262, 337), 'plotly....
Sairam954/bdl-benchmarks
bdlb/diabetic_retinopathy_diagnosis/benchmark.py
6fbc855ca51403ad8f64b6be30ed92f6118c6cae
# Copyright 2019 BDL Benchmarks 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 at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
[((1435, 1514), 'os.path.join', 'os.path.join', (['DATA_DIR', '"""downloads"""', '"""manual"""', '"""diabetic_retinopathy_diagnosis"""'], {}), "(DATA_DIR, 'downloads', 'manual', 'diabetic_retinopathy_diagnosis')\n", (1447, 1514), False, 'import os\n'), ((3842, 3855), 'tqdm.tqdm', 'tqdm.tqdm', (['ds'], {}), '(ds)\n', (3...
agustinhenze/mibs.snmplabs.com
pysnmp-with-texts/CXConsoleDriver-MIB.py
1fc5c07860542b89212f4c8ab807057d9a9206c7
# # PySNMP MIB module CXConsoleDriver-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CXConsoleDriver-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:32:28 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
[]
Lifeistrange/WeiboSpider
db/redis_db.py
8aa3465487ef64bb6e9bb4bd503f182a1b38c292
# coding:utf-8 import datetime import json import re import redis from config.conf import get_redis_args redis_args = get_redis_args() class Cookies(object): rd_con = redis.StrictRedis(host=redis_args.get('host'), port=redis_args.get('port'), password=redis_args.get('password'), d...
[((120, 136), 'config.conf.get_redis_args', 'get_redis_args', ([], {}), '()\n', (134, 136), False, 'from config.conf import get_redis_args\n'), ((1261, 1282), 'json.loads', 'json.loads', (['j_account'], {}), '(j_account)\n', (1271, 1282), False, 'import json\n'), ((1316, 1369), 'datetime.datetime.fromtimestamp', 'datet...
vEpiphyte/vivisect
vivisect/storage/mpfile.py
14947a53c6781175f0aa83d49cc16c524a2e23a3
import base64 import logging import msgpack logger = logging.getLogger(__name__) loadargs = {'use_list': False, 'raw': False} if msgpack.version < (1, 0, 0): loadargs['encoding'] = 'utf-8' else: loadargs['strict_map_key'] = False VSIG = b'MSGVIV'.ljust(8, b'\x00') def vivEventsAppendFile(filename, events)...
[((55, 82), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (72, 82), False, 'import logging\n'), ((818, 859), 'msgpack.pack', 'msgpack.pack', (['VSIG', 'f'], {'use_bin_type': '(False)'}), '(VSIG, f, use_bin_type=False)\n', (830, 859), False, 'import msgpack\n'), ((1323, 1354), 'msgpack.Un...
mathiasose/pytest-pgsql
pytest_pgsql/plugin.py
5e076db146699c3b683b49e4a31323c4c23054de
"""This forms the core of the pytest plugin.""" import pytest import testing.postgresql from pytest_pgsql import database from pytest_pgsql import ext def pytest_addoption(parser): """Add configuration options for pytest_pgsql.""" parser.addoption( '--pg-extensions', action='store', default='', ...
[((976, 1007), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (990, 1007), False, 'import pytest\n'), ((2552, 2607), 'pytest_pgsql.ext.create_engine_fixture', 'ext.create_engine_fixture', (['"""pg_engine"""'], {'scope': '"""session"""'}), "('pg_engine', scope='session')\n",...
abrahamneben/orbcomm_beam_mapping
power_data_to_sat_passes/date_utils.py
71b3e7d6e4214db0a6f4e68ebeeb7d7f846f5004
# written by abraham on aug 24 def dyear2date(dyear): year = int(dyear) month_lengths = [31,28,31,30,31,30,31,31,30,31,30,31] days_before_months = [0,31,59,90,120,151,181,212,243,273,304,334] days_into_year_f = (dyear-year)*365 days_into_year_i = int(days_into_year_f) for i in range(12): if days_before_mo...
[]
sourcery-ai-bot/personal-expenses-accounting
app/base/count_lines.py
55e76744a06fd502d119f57427cd7a0bfaf68fe1
import glob from os import walk exclude_folders = [ 'node_modules', 'ios', 'android', '__pycache__' ] exclude_files = [ 'json', 'txt', 'traineddata', 'lstmf', 'yml', 'md' 'log', 'env', 'gitignore', 'dockerignore' ] # get all files in directory dirr = '/home/vik...
[((400, 440), 'glob.glob', 'glob.glob', (["(dirr + '/**/')"], {'recursive': '(True)'}), "(dirr + '/**/', recursive=True)\n", (409, 440), False, 'import glob\n'), ((618, 641), 'glob.glob', 'glob.glob', (["(folder + '*')"], {}), "(folder + '*')\n", (627, 641), False, 'import glob\n')]
rgurevych/python_for_testers
data/contacts.py
04023a5d6ea480f7828aa56e8a4094b744e05721
from models.contact import Contact testdata = [Contact(first_name="Firstname", last_name="Lastname", mobile_phone="+12345678", work_phone="12345", home_phone="67890", fax="55443322", email_1="email_1@email.com", email_2="email_2@email.com", email_3="emai...
[((49, 328), 'models.contact.Contact', 'Contact', ([], {'first_name': '"""Firstname"""', 'last_name': '"""Lastname"""', 'mobile_phone': '"""+12345678"""', 'work_phone': '"""12345"""', 'home_phone': '"""67890"""', 'fax': '"""55443322"""', 'email_1': '"""email_1@email.com"""', 'email_2': '"""email_2@email.com"""', 'email...
nobuto-m/charm-helpers
charmhelpers/contrib/charmsupport/nrpe.py
4cffc05ace43234d34b040cccdde3460f68cb673
# Copyright 2014-2015 Canonical Limited. # # 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 agreed to in ...
[((12981, 13013), 'charmhelpers.core.hookenv.relations_of_type', 'relations_of_type', (['relation_name'], {}), '(relation_name)\n', (12998, 13013), False, 'from charmhelpers.core.hookenv import config, hook_name, local_unit, log, relation_get, relation_ids, relation_set, relations_of_type\n'), ((13334, 13366), 'charmhe...
mintzer/pupillometry-rf-back
venv/Lib/site-packages/proglog/proglog.py
cfa86fa984a49dce0123798f8de5b838c02e10d5
"""Implements the generic progress logger class, and the ProgressBar class. """ from tqdm import tqdm, tqdm_notebook from collections import OrderedDict import time SETTINGS = { 'notebook': False } def notebook(turn='on'): SETTINGS['notebook'] = True if (turn == 'on') else False def troncate_string(s, max_l...
[((9891, 9938), 'collections.OrderedDict', 'OrderedDict', (['[(bar, None) for bar in self.bars]'], {}), '([(bar, None) for bar in self.bars])\n', (9902, 9938), False, 'from collections import OrderedDict\n'), ((3666, 3679), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (3677, 3679), False, 'from collectio...
jorgepadilla19/gdsfactory
gdsfactory/tests/test_component_from_yaml_bezier.py
68e1c18257a75d4418279851baea417c8899a165
import gdsfactory as gf from gdsfactory.component import Component yaml = """ name: test_component_yaml_without_cell instances: mmi: component: mmi1x2 bend: component: bend_s connections: bend,o1: mmi,o2 """ def test_component_from_yaml_without_cell() -> Component: """bezier does n...
[((344, 367), 'gdsfactory.read.from_yaml', 'gf.read.from_yaml', (['yaml'], {}), '(yaml)\n', (361, 367), True, 'import gdsfactory as gf\n')]
AdamBrianBright/cats-python
cats/types.py
163cbde06c0d56520c217c0d66ddca34c7e0f63b
from pathlib import Path from types import GeneratorType from typing import AsyncIterable, Iterable, TypeAlias import ujson from cats.errors import MalformedHeadersError try: from django.db.models import QuerySet, Model except ImportError: QuerySet = type('QuerySet', (list,), {}) Model = type('Model', (l...
[((1471, 1528), 'cats.errors.MalformedHeadersError', 'MalformedHeadersError', (['"""Invalid offset header"""'], {'headers': 'v'}), "('Invalid offset header', headers=v)\n", (1492, 1528), False, 'from cats.errors import MalformedHeadersError\n'), ((2503, 2523), 'ujson.loads', 'ujson.loads', (['headers'], {}), '(headers)...
MyCollege/raven
raven/utils/urlparse.py
9447f3a55ae7703afe84c3493625e3c3fb700700
from __future__ import absolute_import try: import urlparse as _urlparse except ImportError: from urllib import parse as _urlparse def register_scheme(scheme): for method in filter(lambda s: s.startswith('uses_'), dir(_urlparse)): uses = getattr(_urlparse, method) if scheme not in uses: ...
[]
stjordanis/MONeT-1
setup.py
98a5c7d149ca19c8c64069dbd8f27ce7f97bf3af
import setuptools setuptools.setup( name="monet_memory_optimized_training", version="0.0.1", description="Memory Optimized Network Training Framework", url="https://github.com/philkr/lowrank_conv", packages=setuptools.find_packages(include = ['monet', 'monet.*', 'models', 'checkmate', 'gist']), ...
[((228, 317), 'setuptools.find_packages', 'setuptools.find_packages', ([], {'include': "['monet', 'monet.*', 'models', 'checkmate', 'gist']"}), "(include=['monet', 'monet.*', 'models', 'checkmate',\n 'gist'])\n", (252, 317), False, 'import setuptools\n')]
Superomeg4/pyleecan
Tests/Methods/Machine/test_Magnet_Type_11_meth.py
2b695b5f39e77475a07aa0ea89489fb0a9659337
# -*- coding: utf-8 -*- """ @date Created on Thu Dec 18 13:56:33 2014 @copyright (C) 2014-2015 EOMYS ENGINEERING. @author pierre_b """ from unittest import TestCase from ddt import ddt, data from pyleecan.Classes.Arc1 import Arc1 from pyleecan.Classes.Segment import Segment from pyleecan.Classes.MagnetType11 import...
[((598, 636), 'pyleecan.Classes.LamSlotMag.LamSlotMag', 'LamSlotMag', ([], {'is_internal': '(True)', 'Rext': '(0.5)'}), '(is_internal=True, Rext=0.5)\n', (608, 636), False, 'from pyleecan.Classes.LamSlotMag import LamSlotMag\n'), ((648, 681), 'pyleecan.Classes.SlotMPolar.SlotMPolar', 'SlotMPolar', ([], {'H0': '(0)', 'W...
arshadzahangirchowdhury/TomoEncoders
tomo_encoders/tasks/void_mapping.py
9c2b15fd515d864079f198546821faee5d78df17
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ """ from operator import mod from tomo_encoders.misc.voxel_processing import modified_autocontrast, TimerGPU from tomo_encoders.reconstruction.recon import recon_patches_3d import cupy as cp import numpy as np from skimage.filters import threshold_otsu from tomo_en...
[((688, 724), 'cupy.meshgrid', 'cp.meshgrid', (['pts', 'pts'], {'indexing': '"""ij"""'}), "(pts, pts, indexing='ij')\n", (699, 724), True, 'import cupy as cp\n'), ((850, 882), 'cupy.repeat', 'cp.repeat', (['circ', 'shape_z'], {'axis': '(0)'}), '(circ, shape_z, axis=0)\n', (859, 882), True, 'import cupy as cp\n'), ((127...
roundium/handypackages
handypackages/subscribe/migrations/0001_initial.py
b8a0e4952644144b31168f9a4ac8e743933d87c7
# Generated by Django 2.2.1 on 2019-06-22 11:03 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='SubscribeModel', fields=[ ('id', models.Aut...
[((310, 403), '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", (326, 403), False, 'from django.db import migrations, models\...
lwh2015/TuShare
TuShare/view/sh_margins.py
f244e05e5cf208e18e6237d3b81f71f0d3c1394a
# -*- coding: UTF-8 -*- import json from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt import tushare as ts from .publiceClass import DateEncoder @csrf_exempt def sh_margins(request): try: start = request.POST.get('start','')#选填 end = request.POST.get('end','...
[((341, 366), 'tushare.sh_margins', 'ts.sh_margins', (['start', 'end'], {}), '(start, end)\n', (354, 366), True, 'import tushare as ts\n'), ((676, 703), 'django.http.HttpResponse', 'HttpResponse', (['BaseException'], {}), '(BaseException)\n', (688, 703), False, 'from django.http import HttpResponse\n'), ((743, 758), 'j...
robertob45/learning-python
intermediate/classes/camera.py
7407f7d9e513792150eb2b65ebc644b5f8632c56
class Camera: """docstring for .""" def __init__(self, brand, sensor, lens, battery): self.brand = brand self.sensor = sensor self.lens = lens self.battery = battery def __str__(self): return self.brand + ' ' + self.sensor + ' ' + self.lens + ' ' + self.battery ...
[]
didindinn/database-as-a-service
dbaas/tsuru/tests/test_service_add.py
747de31ff8546f7874ddd654af860e130afd17a0
from mock import patch, MagicMock from django.contrib.auth.models import User from django.test import TestCase from django.core.urlresolvers import reverse from django.utils.datastructures import MultiValueDictKeyError from account.models import Role, Team, Organization from physical.tests.factory import EnvironmentF...
[((6821, 6875), 'mock.patch', 'patch', (['"""notification.tasks.create_database_with_retry"""'], {}), "('notification.tasks.create_database_with_retry')\n", (6826, 6875), False, 'from mock import patch, MagicMock\n'), ((1268, 1308), 'physical.tests.factory.EnvironmentFactory.create', 'EnvironmentFactory.create', ([], {...
Muhammet-Yildiz/Ecommerce_Website-HepsiOrada
Main/migrations/0072_auto_20210506_0016.py
91935014ccc37e0ea57c8cbd2c4891941dcbb917
# Generated by Django 3.1.4 on 2021-05-05 21:16 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('Main', '0071_auto_20210506_0004'), ] operations = [ migrations.RemoveField( model_name='product', name='chooseColor', ...
[((224, 288), 'django.db.migrations.RemoveField', 'migrations.RemoveField', ([], {'model_name': '"""product"""', 'name': '"""chooseColor"""'}), "(model_name='product', name='chooseColor')\n", (246, 288), False, 'from django.db import migrations\n'), ((333, 396), 'django.db.migrations.RemoveField', 'migrations.RemoveFie...
zweed4u/dailycodingproblem
1.py
6e40eaad347e283f86a11adeff01c6426211a0be
#!/usr/bin/python3 """ Good morning! Here's your coding interview problem for today. This problem was recently asked by Google. Given a list of numbers and a number k, return whether any two numbers from the list add up to k. For example, given [10, 15, 3, 7] and k of 17, return true since 10 + 7 is 17. Bonus: Can ...
[]
ow-gryphon/gryphon
gryphon/data/template_scaffolding/template/setup.py
0b34f2f61a50af46b9d1ec1d3c15d53cf4055dd5
import json import setuptools with open("template/README.md", "r") as fh: long_description = fh.read() with open('requirements.txt') as fr: requirements = fr.read().strip().split('\n') with open('metadata.json') as fr: metadata = json.load(fr) setuptools.setup( name="", # Name of the repository ...
[((245, 258), 'json.load', 'json.load', (['fr'], {}), '(fr)\n', (254, 258), False, 'import json\n'), ((640, 666), 'setuptools.find_packages', 'setuptools.find_packages', ([], {}), '()\n', (664, 666), False, 'import setuptools\n')]
Mhaiyang/iccv
train_base3.py
04a8ee52c2323d7ff5cdf03c0be1466e8180d2eb
""" @Time : 201/21/19 10:41 @Author : TaylorMei @Email : mhy845879017@gmail.com @Project : iccv @File : train_base3.py @Function: """ import datetime import os import torch from torch import nn from torch import optim from torch.autograd import Variable from torch.backends import cudnn from torch.ut...
[((1056, 1078), 'misc.check_mkdir', 'check_mkdir', (['ckpt_path'], {}), '(ckpt_path)\n', (1067, 1078), False, 'from misc import AvgMeter, check_mkdir\n'), ((1137, 1177), 'os.path.join', 'os.path.join', (['ckpt_path', 'exp_name', '"""log"""'], {}), "(ckpt_path, exp_name, 'log')\n", (1149, 1177), False, 'import os\n'), (...
uwase-diane/min_pitch
tests/test_comment.py
514ab5da150244e900fd51b6563173a905ef4f29
import unittest from app.models import Comment, Pitch from app import db class TestPitchComment(unittest.TestCase): def setUp(self): self.new_pitch = Pitch(post = "doit", category='Quotes') self.new_comment = Comment(comment = "good comment", pitch=self.new_pitch) def test_instance(se...
[((164, 201), 'app.models.Pitch', 'Pitch', ([], {'post': '"""doit"""', 'category': '"""Quotes"""'}), "(post='doit', category='Quotes')\n", (169, 201), False, 'from app.models import Comment, Pitch\n'), ((231, 284), 'app.models.Comment', 'Comment', ([], {'comment': '"""good comment"""', 'pitch': 'self.new_pitch'}), "(co...
itteamforslp/safelife_project
teacher/views.py
53af23dec0d19acf7227a43a16d7aedad443e90d
from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import csrf_exempt from django.template import loader from django.db import connection from django.http import HttpResponseRedirect import datetime from dj...
[((776, 810), 'django.contrib.auth.decorators.login_required', 'login_required', ([], {'login_url': '"""/users"""'}), "(login_url='/users')\n", (790, 810), False, 'from django.contrib.auth.decorators import login_required\n'), ((2666, 2711), 'django.template.loader.get_template', 'loader.get_template', (['"""teacher/da...
botstory/bot-story
botstory/middlewares/text/text_test.py
9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3
import logging import pytest import re from . import text from ... import matchers from ...utils import answer, SimpleTrigger logger = logging.getLogger(__name__) @pytest.mark.asyncio async def test_should_run_story_on_equal_message(): trigger = SimpleTrigger() with answer.Talk() as talk: story = ta...
[((136, 163), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (153, 163), False, 'import logging\n')]
xqt/pwb
pywikibot/site/_datasite.py
9a4fe27138f32952e533256195849d05855df0b0
"""Objects representing API interface to Wikibase site.""" # # (C) Pywikibot team, 2012-2022 # # Distributed under the terms of the MIT license. # import datetime import json import uuid from contextlib import suppress from typing import Optional from warnings import warn import pywikibot from pywikibot.data import ap...
[((3677, 3703), 'pywikibot.site._decorators.need_version', 'need_version', (['"""1.28-wmf.3"""'], {}), "('1.28-wmf.3')\n", (3689, 3703), False, 'from pywikibot.site._decorators import need_extension, need_right, need_version\n'), ((3966, 3993), 'pywikibot.site._decorators.need_version', 'need_version', (['"""1.28-wmf.2...
MisaelVillaverde/fourier-calculator
app.py
fd50cd292e333c1a9d75e93962a0aaa0985ecef9
from flask import Flask from flask import render_template, request from flask import jsonify import requests import json app = Flask(__name__) @app.route("/symbo",methods=['POST']) def symbo(): #import pdb; pdb.set_trace() session = requests.session() token = session.get("https://es.symbolab.com/solver/s...
[((128, 143), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (133, 143), False, 'from flask import Flask\n'), ((244, 262), 'requests.session', 'requests.session', ([], {}), '()\n', (260, 262), False, 'import requests\n'), ((1160, 1189), 'flask.render_template', 'render_template', (['"""index.html"""'], {})...
kalona/Spark-The-Definitive-Guide
my_code/Chapter_2.py
0b495c4710b2030aa59d5a7f4053ee0a8345d0d8
from pyspark.sql import SparkSession # spark = SparkSession.builder.master("local[*]").getOrCreate() spark = SparkSession.builder.getOrCreate() file_path = "C:\home_work\local_github\Spark-The-Definitive-Guide\data\/flight-data\csv\/2015-summary.csv" # COMMAND ---------- # COMMAND ---------- flightData2015 = spa...
[((111, 145), 'pyspark.sql.SparkSession.builder.getOrCreate', 'SparkSession.builder.getOrCreate', ([], {}), '()\n', (143, 145), False, 'from pyspark.sql import SparkSession\n'), ((876, 888), 'pyspark.sql.functions.col', 'col', (['"""count"""'], {}), "('count')\n", (879, 888), False, 'from pyspark.sql.functions import m...
ContinuumIO/intake-postgres
tests/test_intake_postgres.py
fda7f7b2b6255544ea7ffd365a4ac8b2655fd226
import os import pickle import pytest import pandas as pd from shapely import wkt from intake_postgres import PostgresSource from intake import open_catalog from .util import verify_datasource_interface TEST_DATA_DIR = 'tests' TEST_DATA = [ ('sample1', 'sample1.csv'), ('sample2_1', 'sample2_1.csv'), ('sa...
[((736, 766), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""module"""'}), "(scope='module')\n", (750, 766), False, 'import pytest\n'), ((1804, 1854), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""table_name,_"""', 'TEST_DATA'], {}), "('table_name,_', TEST_DATA)\n", (1827, 1854), False, 'import py...
dks1018/CoffeeShopCoding
Module_3/testImage.py
13ac1700673c86c601eb2758570920620a956e4c
# file = open('C:\\Users\\dks10\\OneDrive\\Desktop\\Projects\\Code\\Python\\PythonCrypto\\Module_3\\eye.png', 'rb') file = open('encrypt_eye.png', 'rb') image = file.read() file.close() image = bytearray(image) key = 48 for index, value in enumerate(image): image[index] = value^key file = open('2eye.png','wb') ...
[]
Aircoookie/LedFx
ledfxcontroller/effects/temporal.py
95628fc237497dd89aaf30fdbf88f780f3330166
import time import logging from ledfxcontroller.effects import Effect from threading import Thread import voluptuous as vol _LOGGER = logging.getLogger(__name__) DEFAULT_RATE = 1.0 / 60.0 @Effect.no_registration class TemporalEffect(Effect): _thread_active = False _thread = None CONFIG_SCHEMA = vol.Schem...
[((135, 162), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (152, 162), False, 'import logging\n'), ((1434, 1469), 'threading.Thread', 'Thread', ([], {'target': 'self.thread_function'}), '(target=self.thread_function)\n', (1440, 1469), False, 'from threading import Thread\n'), ((332, 366...
Surferlul/csc-python-solutions
07/c/3 - Square Census.py
bea99e5e1e344d17fb2cb29d8bcbc6b108e24cee
n=int(input()) c = 1 while c**2 < n: print(c**2) c += 1
[]
LuChang-CS/sherbet
utils.py
d1061aca108eab8e0ccbd2202460e25261fdf1d5
import numpy as np class DataGenerator: def __init__(self, inputs, shuffle=True, batch_size=32): assert len(inputs) > 0 self.inputs = inputs self.idx = np.arange(len(inputs[0])) self.shuffle = shuffle self.batch_size = batch_size self.on_epoch_end() def data_le...
[((831, 858), 'numpy.random.shuffle', 'np.random.shuffle', (['self.idx'], {}), '(self.idx)\n', (848, 858), True, 'import numpy as np\n')]
sudhanshu55/Speech_to_Image
Version1_STI.py
7a047725b3167cfcb7a68004b3c35b2ece75fde4
from nltk.tokenize import sent_tokenize, word_tokenize from nltk.corpus import stopwords import speech_recognition as sr import nltk from google_images_download import google_images_download response = google_images_download.googleimagesdownload() r = sr.Recognizer() with sr.Microphone() as source: print("Say some...
[((203, 248), 'google_images_download.google_images_download.googleimagesdownload', 'google_images_download.googleimagesdownload', ([], {}), '()\n', (246, 248), False, 'from google_images_download import google_images_download\n'), ((253, 268), 'speech_recognition.Recognizer', 'sr.Recognizer', ([], {}), '()\n', (266, 2...
jonathanlloyd/scratchstack-httpserver
src/models.py
72f9bb5b1673b132786d94c017dbf2d370886b79
from dataclasses import dataclass @dataclass class Request: method: str path: str headers: dict body: bytes @dataclass class Response: status_code: int reason_phrase: str headers: dict body: bytes
[]
EdwardZX/hoomd-blue
hoomd/communicator.py
c87ac3f136534e8a80359a2faceeb730f445da21
# Copyright (c) 2009-2021 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause # License. """MPI communicator.""" from hoomd import _hoomd import hoomd import contextlib class Communicator(object): """MPI communicator. Args: mpi_c...
[((1818, 1843), 'hoomd._hoomd.MPIConfiguration', '_hoomd.MPIConfiguration', ([], {}), '()\n', (1841, 1843), False, 'from hoomd import _hoomd\n'), ((5167, 5193), 'hoomd._hoomd.mpi_barrier_world', '_hoomd.mpi_barrier_world', ([], {}), '()\n', (5191, 5193), False, 'from hoomd import _hoomd\n'), ((2718, 2775), 'hoomd._hoom...
dominc8/affinity-propagation
src/affinity-propagation/generate_data.py
b91b18b52eb68a7eafaadf0ceac39fe10955dcf2
from config import DataGeneratorCfg from sklearn.datasets.samples_generator import make_blobs import numpy as np def generate(): data, true_labels = make_blobs(n_samples=DataGeneratorCfg.n_samples, centers=DataGeneratorCfg.centers, cluster_std=DataGeneratorCfg.cluster_std, random_state=DataGeneratorCfg.random_stat...
[((154, 332), 'sklearn.datasets.samples_generator.make_blobs', 'make_blobs', ([], {'n_samples': 'DataGeneratorCfg.n_samples', 'centers': 'DataGeneratorCfg.centers', 'cluster_std': 'DataGeneratorCfg.cluster_std', 'random_state': 'DataGeneratorCfg.random_state'}), '(n_samples=DataGeneratorCfg.n_samples, centers=DataGener...
roch1990/peon
peon/tests/test_project/test_file/test_function_def/test_functions/test_reflection_at_line.py
0e9e40956c05138c0820fe380b354fdd1fe95e01
import _ast from peon.src.project.file.function_def.function import FunctionLint class ReflectionAtLineFixture: empty_node = _ast.Pass is_instance_at_first_lvl = _ast.FunctionDef(id='isinstance', lineno=1) type_at_first_lvl = _ast.FunctionDef(id='type', lineno=1) is_instance_at_second_lvl = _ast.Func...
[((173, 216), '_ast.FunctionDef', '_ast.FunctionDef', ([], {'id': '"""isinstance"""', 'lineno': '(1)'}), "(id='isinstance', lineno=1)\n", (189, 216), False, 'import _ast\n'), ((241, 278), '_ast.FunctionDef', '_ast.FunctionDef', ([], {'id': '"""type"""', 'lineno': '(1)'}), "(id='type', lineno=1)\n", (257, 278), False, '...
Nama/A.T.S.P.-Website
db2_funcs.py
658db78da1b12c01ef9ead2dc44d1ecd97b178d8
############################################################################### # # '''Website Database-connection-related features''' # # # ...
[((1043, 1121), 'cymysql.connect', 'cymysql.connect', ([], {'host': 'db_host', 'port': 'db_port', 'user': 'db_user', 'passwd': 'db_pw', 'db': 'db'}), '(host=db_host, port=db_port, user=db_user, passwd=db_pw, db=db)\n', (1058, 1121), False, 'import cymysql\n'), ((1722, 1730), 'time.gmtime', 'gmtime', ([], {}), '()\n', (...
rgschmitz1/tcss702
nlp/handler.py
b0fdd7b6107401dc297b467c9e63773dfb8fd487
from minio import Minio import json import os from .Inspector import Inspector from .topic_model import topic_model #def handle(event): def handle(event, context): with open("/var/openfaas/secrets/minio-access-key") as f: access_key = f.read() with open("/var/openfaas/secrets/minio-secret-key") as f: ...
[((359, 459), 'minio.Minio', 'Minio', (["os.environ['minio_hostname']"], {'access_key': 'access_key', 'secret_key': 'secret_key', 'secure': '(False)'}), "(os.environ['minio_hostname'], access_key=access_key, secret_key=\n secret_key, secure=False)\n", (364, 459), False, 'from minio import Minio\n'), ((772, 794), 'js...
jmangs/prometheus-pve-exporter
src/pve_exporter/cli.py
2947a1247d854791114eb5ed348a250739540708
""" Proxmox VE exporter for the Prometheus monitoring system. """ import sys from argparse import ArgumentParser from pve_exporter.http import start_http_server def main(args=None): """ Main entry point. """ parser = ArgumentParser() parser.add_argument('config', nargs='?', default='pve.yml', ...
[((236, 252), 'argparse.ArgumentParser', 'ArgumentParser', ([], {}), '()\n', (250, 252), False, 'from argparse import ArgumentParser\n'), ((741, 802), 'pve_exporter.http.start_http_server', 'start_http_server', (['params.config', 'params.port', 'params.address'], {}), '(params.config, params.port, params.address)\n', (...
vinodkahuja/augur
workers/repo_info_worker/repo_info_worker.py
a7688af262c2f971767962d4a20110daf4b1179a
#SPDX-License-Identifier: MIT import logging, os, sys, time, requests, json from datetime import datetime from multiprocessing import Process, Queue import pandas as pd import sqlalchemy as s from workers.worker_base import Worker # NOTE: This worker primarily inserts rows into the REPO_INFO table, which serves the pr...
[((10670, 10709), 'requests.get', 'requests.get', (['url'], {'headers': 'self.headers'}), '(url, headers=self.headers)\n', (10682, 10709), False, 'import logging, os, sys, time, requests, json\n'), ((11137, 11176), 'requests.get', 'requests.get', (['url'], {'headers': 'self.headers'}), '(url, headers=self.headers)\n', ...
victor-estrade/SystGradDescent
benchmark/my_argparser.py
822e7094290301ec47a99433381a8d6406798aff
# coding: utf-8 from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import argparse def parse_args_tolerance(): parser = argparse.ArgumentParser(description='just for tolerance') parser.add_argument("--tolerance"...
[((225, 282), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""just for tolerance"""'}), "(description='just for tolerance')\n", (248, 282), False, 'import argparse\n'), ((575, 628), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': 'main_description'}), '(descript...
SarthakJariwala/Shockley-Queisser-Calculator
src/main/python/main.py
5f9cfd4c97b8141e8b4ee8d15fa5f3cccfe25b7e
from fbs_runtime.application_context.PyQt5 import ApplicationContext, cached_property from fbs_runtime.platform import is_windows, is_mac # system imports import sys # module imports from PyQt5 import uic, QtWidgets from PyQt5.QtWidgets import QMessageBox import numpy as np import matplotlib.pyplot as plt import matp...
[((941, 953), 'fbs_runtime.platform.is_windows', 'is_windows', ([], {}), '()\n', (951, 953), False, 'from fbs_runtime.platform import is_windows, is_mac\n'), ((959, 983), 'matplotlib.use', 'matplotlib.use', (['"""Qt5Agg"""'], {}), "('Qt5Agg')\n", (973, 983), False, 'import matplotlib\n'), ((989, 997), 'fbs_runtime.plat...
tov101/HelpUs
helpus/core.py
6b53d9651cf45c191774be2f70b70b130251d2a6
import io import logging import os import sys from PyQt5 import QtGui, QtCore, QtWidgets from helpus import icon_file_path from helpus import __version__ LOGGER = logging.getLogger('HelpUs') LOGGER.setLevel(logging.DEBUG) class XStream(QtCore.QObject): _stdout = None _stderr = None messageWritten = QtCo...
[((165, 192), 'logging.getLogger', 'logging.getLogger', (['"""HelpUs"""'], {}), "('HelpUs')\n", (182, 192), False, 'import logging\n'), ((316, 338), 'PyQt5.QtCore.pyqtSignal', 'QtCore.pyqtSignal', (['str'], {}), '(str)\n', (333, 338), False, 'from PyQt5 import QtGui, QtCore, QtWidgets\n'), ((1012, 1034), 'PyQt5.QtCore....
newgene/biothings.api
biothings/hub/dataindex/indexer_schedule.py
e3278695ac15a55fe420aa49c464946f81ec019d
import math class Schedule(): def __init__(self, total, batch_size): self._batch_size = batch_size self._state = "" self.total = total self.scheduled = 0 self.finished = 0 @property def _batch(self): return math.ceil(self.scheduled / self._batch_size) ...
[((272, 316), 'math.ceil', 'math.ceil', (['(self.scheduled / self._batch_size)'], {}), '(self.scheduled / self._batch_size)\n', (281, 316), False, 'import math\n'), ((371, 411), 'math.ceil', 'math.ceil', (['(self.total / self._batch_size)'], {}), '(self.total / self._batch_size)\n', (380, 411), False, 'import math\n')]
voBits/ccxt
examples/py/async-basic.py
edd2dd92053bd06232769a63465a43912b21eda0
# -*- coding: utf-8 -*- import asyncio import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt.async as ccxt # noqa: E402 async def test_gdax(): gdax = ccxt.gdax() markets = await gdax.load_markets() await g...
[]
bennettdc/MCEdit-Unified
pymclevel/test/__init__.py
90abfb170c65b877ac67193e717fa3a3ded635dd
__author__ = 'Rio'
[]
ethz-asl/modular_semantic_segmentation
xview/datasets/wrapper.py
7c950f24df11540a7ddae4ff806d5b31934a3210
from abc import ABCMeta, abstractmethod class DataWrapper: """Interface for access to datasets.""" __metaclass__ = ABCMeta @abstractmethod def next(self): """Returns next minibatch for training.""" return NotImplementedError
[]
jrbourbeau/partd
partd/core.py
74016a296a760de9c7a0e0d4b012a3478c9a0831
from __future__ import absolute_import import os import shutil import locket import string from toolz import memoize from contextlib import contextmanager from .utils import nested_get, flatten # http://stackoverflow.com/questions/295135/turn-a-string-into-a-valid-filename-in-python valid_chars = "-_.() " + string....
[]
VITA-Group/Adv-SS-Pretraining
pretraining/model_ensemble.py
4ffbebea582f858ec6165f082f52ded1fc9b817d
''' model ensemble for cifar10 // input size(32,32) ''' import torch import torchvision import copy import torch.nn as nn from resnetv2 import ResNet50 as resnet50v2 def split_resnet50(model): return nn.Sequential( model.conv1, model.layer1, model.layer2, mode...
[((224, 292), 'torch.nn.Sequential', 'nn.Sequential', (['model.conv1', 'model.layer1', 'model.layer2', 'model.layer3'], {}), '(model.conv1, model.layer1, model.layer2, model.layer3)\n', (237, 292), True, 'import torch.nn as nn\n'), ((652, 670), 'torch.nn.Linear', 'nn.Linear', (['(2048)', '(4)'], {}), '(2048, 4)\n', (66...
glciampaglia/HoaxyBots
scripts/ccdf.py
db8d2b7d9927d5d4d94ded125f9785590dace906
# -*- coding: utf-8 -*- """ Function that implement Complement the Complementary Cumulative Distribution Function (CCDF). """ # # written by Chengcheng Shao <sccotte@gmail.com> import numpy as np import pandas as pd def ccdf(s): """ Parameters: `s`, series, the values of s should be variable to be ha...
[((965, 1001), 'pandas.Series', 'pd.Series', (['cumulative'], {'index': 's.index'}), '(cumulative, index=s.index)\n', (974, 1001), True, 'import pandas as pd\n'), ((1482, 1518), 'pandas.Series', 'pd.Series', (['cumulative'], {'index': 's.index'}), '(cumulative, index=s.index)\n', (1491, 1518), True, 'import pandas as p...
eliracho37/lifelines
lifelines/fitters/kaplan_meier_fitter.py
b1c6c2732d1ccfc2ae08f7178371d0f95ae3027b
# -*- coding: utf-8 -*- from __future__ import print_function import numpy as np import pandas as pd from lifelines.fitters import UnivariateFitter from lifelines.utils import _preprocess_inputs, _additive_estimate, StatError, inv_normal_cdf,\ median_survival_times from lifelines.plotting import plot_loglogs cla...
[((2218, 2280), 'lifelines.utils._preprocess_inputs', '_preprocess_inputs', (['durations', 'event_observed', 'timeline', 'entry'], {}), '(durations, event_observed, timeline, entry)\n', (2236, 2280), False, 'from lifelines.utils import _preprocess_inputs, _additive_estimate, StatError, inv_normal_cdf, median_survival_t...
fishjojo/pydmfe
pydmfet/qcwrap/pyscf_rhf.py
93cfc655314933d3531b5733521a1f95a044f6cb
import numpy as np from pydmfet import tools from .fermi import find_efermi, entropy_corr from pyscf import ao2mo, gto, scf, dft, lib from pydmfet.qcwrap import fermi import time from functools import reduce def scf_oei( OEI, Norb, Nelec, smear_sigma = 0.0): OEI = 0.5*(OEI.T + OEI) eigenvals, eigenvecs = np.l...
[((316, 335), 'numpy.linalg.eigh', 'np.linalg.eigh', (['OEI'], {}), '(OEI)\n', (330, 335), True, 'import numpy as np\n'), ((686, 700), 'numpy.zeros', 'np.zeros', (['Norb'], {}), '(Norb)\n', (694, 700), True, 'import numpy as np\n'), ((1036, 1068), 'numpy.set_printoptions', 'np.set_printoptions', ([], {'precision': '(4)...
tautschnig/one-line-scan
backends/fortify/summarize-fortify.py
24e1deedd595e3406eb8d5c69ff9629c5a87d0aa
#!/usr/bin/env python # # Copyright Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENS...
[]
r4b3rt/angr
angr/procedures/definitions/win32_wsmsvc.py
c133cfd4f83ffea2a1d9e064241e9459eaabc55f
# pylint:disable=line-too-long import logging from ...sim_type import SimTypeFunction, SimTypeShort, SimTypeInt, SimTypeLong, SimTypeLongLong, SimTypeDouble, SimTypeFloat, SimTypePointer, SimTypeChar, SimStruct, SimTypeFixedSizeArray, SimTypeBottom, SimUnion, SimTypeBool from ...calling...
[((441, 473), 'logging.getLogger', 'logging.getLogger', ([], {'name': '__name__'}), '(name=__name__)\n', (458, 473), False, 'import logging\n')]
bachya/aiolookin
aiolookin/__init__.py
553731047b6910b1cb74667fbb343faf9b8656ac
"""Define the aiolookin package.""" from .device import async_get_device # noqa
[]
yuemingl/ode-python-1
odepy/collision_space.py
a9a12d9d3b7e611874a8d30f6a5c0b83b6087f86
# -*- coding: utf-8 -*- from .common import loadOde from .common import dGeomID from .common import dSpaceID from .common import dVector3 from ctypes import POINTER from ctypes import CFUNCTYPE from ctypes import c_void_p from ctypes import c_int32 dNearCallback = CFUNCTYPE(None, c_void_p, dGeomID, dGeomID) def dSi...
[((268, 311), 'ctypes.CFUNCTYPE', 'CFUNCTYPE', (['None', 'c_void_p', 'dGeomID', 'dGeomID'], {}), '(None, c_void_p, dGeomID, dGeomID)\n', (277, 311), False, 'from ctypes import CFUNCTYPE\n'), ((1150, 1166), 'ctypes.POINTER', 'POINTER', (['c_int32'], {}), '(c_int32)\n', (1157, 1166), False, 'from ctypes import POINTER\n'...
phildavis17/DS_A
bst.py
2d950a62b1ea36dff5dcd2c17266ddf088719472
class BSTNode: def __init__(self, data = None) -> None: self.data = data self.left = None self.right = None def __repr__(self) -> str: return(f"BSTNode({self.data})") def __str__(self) -> str: return str(self.data) def __eq__(self, o: object) -> ...
[]
DaveWK/pyth-client
pctest/test_publish.py
4332ef3287f584be46ec38ddd800cae8d4e7b792
#!/usr/bin/python3 # pip3 install websockets import asyncio import websockets import json import datetime import sys class test_publish: idnum = 1 def __init__( self, sym, price, spread ): self.symbol = sym self.pidnum = test_publish.idnum test_publish.idnum += 1 self.sidnum = test_publish.idnum ...
[((4109, 4133), 'asyncio.get_event_loop', 'asyncio.get_event_loop', ([], {}), '()\n', (4131, 4133), False, 'import asyncio\n'), ((698, 713), 'json.dumps', 'json.dumps', (['req'], {}), '(req)\n', (708, 713), False, 'import json\n'), ((987, 1002), 'json.dumps', 'json.dumps', (['req'], {}), '(req)\n', (997, 1002), False, ...
TechSpiritSS/NeoAlgo
Python/other/merge_interval.py
08f559b56081a191db6c6b1339ef37311da9e986
''' Given an array of intervals, merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input. Input: intervals = [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, merge them into [1,6]....
[]
InnovativeTravel/humilis-lambdautils
tests/test_all.py
344e13efb68d19f61f0be8178eb6cc2219913fb0
"""Unit tests.""" import inspect import json from mock import Mock import os import sys import uuid import pytest # Add the lambda directory to the python library search path lambda_dir = os.path.join( os.path.dirname(inspect.getfile(inspect.currentframe())), '..') sys.path.append(lambda_dir) import lambdautils...
[((273, 300), 'sys.path.append', 'sys.path.append', (['lambda_dir'], {}), '(lambda_dir)\n', (288, 300), False, 'import sys\n'), ((330, 612), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""key,environment,stage,namespace,table,nkey"""', "[('k', 'e', 's', None, 'e-s-secrets', 'k'), ('k', 'e', None, None,\n ...
sot/ska_testr
packages/starcheck/post_regress.py
dd84b89d0b5ebf6158c6cda4c1df432138044e20
import os from testr.packages import make_regress_files regress_files = ['starcheck.txt', 'starcheck/pcad_att_check.txt'] clean = {'starcheck.txt': [(r'\s*Run on.*[\n\r]*', ''), (os.environ['SKA'], '')], 'starcheck/pcad_att_check.txt': [(os.environ['SKA'], '')]} m...
[((319, 365), 'testr.packages.make_regress_files', 'make_regress_files', (['regress_files'], {'clean': 'clean'}), '(regress_files, clean=clean)\n', (337, 365), False, 'from testr.packages import make_regress_files\n')]
stungkit/djaodjin-saas
testsite/wsgi.py
93c8631509ffd5b0fb91283cd4a4aeaf9826e97e
""" WSGI config for testsite project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
[((860, 888), 'os.getenv', 'os.getenv', (['"""DJANGO_COVERAGE"""'], {}), "('DJANGO_COVERAGE')\n", (869, 888), False, 'import os, signal\n'), ((1353, 1421), 'os.environ.setdefault', 'os.environ.setdefault', (['"""DJANGO_SETTINGS_MODULE"""', '"""testsite.settings"""'], {}), "('DJANGO_SETTINGS_MODULE', 'testsite.settings'...
jdelic/authserver
authserver/maildaemons/forwarder/server.py
e800664436b252fcdf224a9af46a1122c87be3ca
#!/usr/bin/env python3 -u # -* encoding: utf-8 *- import argparse import asyncore import json import logging import signal import sys import os from types import FrameType from typing import Tuple, Sequence, Any, Union, Optional, List, Dict from concurrent.futures import ThreadPoolExecutor as Pool import daemon from...
[((467, 494), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (484, 494), False, 'import logging\n'), ((502, 508), 'concurrent.futures.ThreadPoolExecutor', 'Pool', ([], {}), '()\n', (506, 508), True, 'from concurrent.futures import ThreadPoolExecutor as Pool\n'), ((7274, 7289), 'asyncore.l...
kzkaneoka/custom-job-search
services/backend/project/api/sites.py
ca6054aee979cb1eff701dc5ba0cf56fb92baf44
import requests from bs4 import BeautifulSoup, element class Indeed: def __init__(self, words, location, offset): self.url = "https://www.indeed.com/jobs?as_and={}&l={}&sort=date&start={}".format( "+".join(set(d.strip().lower() for d in words.split(",") if d)), "+".join(list(d.lowe...
[((1816, 1838), 'requests.get', 'requests.get', (['self.url'], {}), '(self.url)\n', (1828, 1838), False, 'import requests\n'), ((1891, 1927), 'bs4.BeautifulSoup', 'BeautifulSoup', (['r.text', '"""html.parser"""'], {}), "(r.text, 'html.parser')\n", (1904, 1927), False, 'from bs4 import BeautifulSoup, element\n')]
gene1wood/django-product-details
product_details/utils.py
53f245d76fa11d073ba686e0ece7b0293ec21942
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from product_details import settings_defaults def settings_fallback(key): """Grab user-defined settings, or fall back to default.""" try: return getattr(settings, key) except (AttributeError, ImportError, Imp...
[((613, 634), 'django.core.cache.get_cache', 'get_cache', (['cache_name'], {}), '(cache_name)\n', (622, 634), False, 'from django.core.cache import get_cache\n')]
jaredliw/python-question-bank
kattis/Soda Slurper.py
9c8c246623d8d171f875700b57772df0afcbdcdf
# CPU: 0.06 s possessed, found, condition = map(int, input().split()) possessed += found count = 0 while possessed >= condition: div, mod = divmod(possessed, condition) count += div possessed = div + mod print(count)
[]
HyunjiEllenPak/automl
efficientdet/dataset/csv_.py
fedf04adf12c5fd11045ea06e2f5c11a5a5490c4
""" Copyright 2017-2018 yhenon (https://github.com/yhenon/) Copyright 2017-2018 Fizyr (https://fizyr.com) 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-...
[((1379, 1392), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (1390, 1392), False, 'from collections import OrderedDict\n'), ((2411, 2424), 'collections.OrderedDict', 'OrderedDict', ([], {}), '()\n', (2422, 2424), False, 'from collections import OrderedDict\n'), ((4643, 4656), 'collections.OrderedDict', '...