repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
he-actlab/polymath
polymath/srdfg/base.py
9b7937d0ddf7452f6cc74ee90d05f8c6acef737e
from polymath import UNSET_SHAPE, DEFAULT_SHAPES import builtins import operator from collections import OrderedDict, Mapping, Sequence, deque import functools from numbers import Integral, Rational, Real import contextlib import traceback import uuid import numpy as np import importlib from .graph import Graph from ....
[((1238, 1251), 'collections.deque', 'deque', (['[None]'], {}), '([None])\n', (1243, 1251), False, 'from collections import OrderedDict, Mapping, Sequence, deque\n'), ((46542, 46565), 'functools.wraps', 'functools.wraps', (['target'], {}), '(target)\n', (46557, 46565), False, 'import functools\n'), ((1981, 1994), 'coll...
rngallen/beyond_basics
actors/models.py
2cfb7d97699a733251e68357a70eada3d0278680
from django.db import models from django.utils.translation import ugettext_lazy as _ # Create your models here. class Actor(models.Model): name = models.CharField(_("name"), max_length=200) # if is_star he/she will be directed to hollywood else directed to commercial is_star = models.BooleanField(_("is s...
[((170, 179), 'django.utils.translation.ugettext_lazy', '_', (['"""name"""'], {}), "('name')\n", (171, 179), True, 'from django.utils.translation import ugettext_lazy as _\n'), ((313, 326), 'django.utils.translation.ugettext_lazy', '_', (['"""is start"""'], {}), "('is start')\n", (314, 326), True, 'from django.utils.tr...
cwlalyy/mongo-c-driver
docs/buildscripts/docs.py
d771be13bc8f7d8b84d233de6fdc725d9bb337cc
"""Build the C client docs. """ from __future__ import with_statement import os import shutil import socket import subprocess import time import urllib2 def clean_dir(dir): try: shutil.rmtree(dir) except: pass os.makedirs(dir) def gen_api(dir): clean_dir(dir) clean_dir("docs/sourc...
[((240, 256), 'os.makedirs', 'os.makedirs', (['dir'], {}), '(dir)\n', (251, 256), False, 'import os\n'), ((458, 500), 'os.rename', 'os.rename', (['"""docs/source/doxygen/html"""', 'dir'], {}), "('docs/source/doxygen/html', dir)\n", (467, 500), False, 'import os\n'), ((546, 576), 'os.chdir', 'os.chdir', (['"""docs/sourc...
defgsus/thegame
tilegame/render/rs.py
38a627d9108f1418b94b08831fd640dd87fbba83
import glm import math from lib.opengl import RenderSettings class GameProjection: def __init__(self, rs: "GameRenderSettings"): self.rs = rs self.scale = 10. self.rotation_deg = 0. self.location = glm.vec3(0) self._stack = [] def projection_matrix_4(self) -> glm.mat...
[((1632, 1643), 'math.sin', 'math.sin', (['a'], {}), '(a)\n', (1640, 1643), False, 'import math\n'), ((1653, 1664), 'math.cos', 'math.cos', (['a'], {}), '(a)\n', (1661, 1664), False, 'import math\n'), ((1676, 1716), 'glm.mat3', 'glm.mat3', (['ca', 'sa', '(0)', '(-sa)', 'ca', '(0)', '(0)', '(0)', '(1)'], {}), '(ca, sa, ...
stungkit/pytorch
tools/stats/export_slow_tests.py
0f05e398705bf15406bce79f7ee57d3935ad2abd
#!/usr/bin/env python3 import argparse import json import os import statistics from collections import defaultdict from tools.stats.s3_stat_parser import ( get_previous_reports_for_branch, Report, Version2Report, ) from typing import cast, DefaultDict, Dict, List, Any from urllib.request import urlopen SL...
[((548, 607), 'tools.stats.s3_stat_parser.get_previous_reports_for_branch', 'get_previous_reports_for_branch', (['"""origin/viable/strict"""', '""""""'], {}), "('origin/viable/strict', '')\n", (579, 607), False, 'from tools.stats.s3_stat_parser import get_previous_reports_for_branch, Report, Version2Report\n'), ((753, ...
michaeltashman/Horizon
ml/rl/evaluation/weighted_sequential_doubly_robust_estimator.py
ee310b34adeb807bbae379a6e1703d0f725f26a9
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import itertools import logging import numpy as np import scipy as sp import torch from ml.rl.evaluation.cpe import CpeEstimate from ml.rl.evaluation.evaluation_data_page import EvaluationDataPage logger = logging.getLogg...
[((305, 332), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (322, 332), False, 'import logging\n'), ((2219, 2257), 'numpy.cumprod', 'np.cumprod', (['importance_weights'], {'axis': '(1)'}), '(importance_weights, axis=1)\n', (2229, 2257), True, 'import numpy as np\n'), ((2604, 2675), 'nump...
HeRuivio/-Algorithm
LeetCode/2019-08-03-384-Shuffle-an-Array.py
1fbe6256630758fda3af68f469471ee246730afc
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2019-08-03 10:48:30 # @Last Modified by: 何睿 # @Last Modified time: 2019-08-03 10:53:15 import copy import random from typing import List class Solution: def __init__(self, nums: List[int]): self.shuffle_ = nums self.orig...
[((327, 342), 'copy.copy', 'copy.copy', (['nums'], {}), '(nums)\n', (336, 342), False, 'import copy\n'), ((619, 648), 'random.shuffle', 'random.shuffle', (['self.shuffle_'], {}), '(self.shuffle_)\n', (633, 648), False, 'import random\n')]
shakedna1/wspc_rep
src/wspc/feature_selection.py
f4492af8cec25a3f7b00687c08d30754a1c0c91f
import numpy as np import sklearn import pandas as pd import scipy.spatial.distance as ssd from scipy.cluster import hierarchy from scipy.stats import chi2_contingency from sklearn.base import BaseEstimator from sklearn.ensemble import RandomForestClassifier from sklearn.feature_extraction.text import CountVectorizer f...
[((1112, 1129), 'pandas.crosstab', 'pd.crosstab', (['x', 'y'], {}), '(x, y)\n', (1123, 1129), True, 'import pandas as pd\n'), ((1239, 1256), 'numpy.sqrt', 'np.sqrt', (['(chi2 / n)'], {}), '(chi2 / n)\n', (1246, 1256), True, 'import numpy as np\n'), ((1453, 1489), 'pandas.DataFrame.sparse.from_spmatrix', 'pd.DataFrame.s...
fsj-digital/pages
Python3/PS_scraping_selenium.py
8360f27e67974ed2b4f39eb64377f39c0189a224
from bs4 import BeautifulSoup import requests import re from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium import webdriver from seleni...
[((1107, 1124), 'requests.get', 'requests.get', (['URL'], {}), '(URL)\n', (1119, 1124), False, 'import requests\n'), ((1140, 1182), 'bs4.BeautifulSoup', 'BeautifulSoup', (['content.text', '"""html.parser"""'], {}), "(content.text, 'html.parser')\n", (1153, 1182), False, 'from bs4 import BeautifulSoup\n'), ((1296, 1314)...
STRATOLOGIC/SpacePyLibrary
AppTest/testTCPserver.py
89fc3873c6d787ad4e391f6080d9dd3218ffc4a2
#!/usr/bin/env python3 #****************************************************************************** # (C) 2018, Stefan Korner, Austria * # * # The Space Python Library is free software; you can redi...
[((5010, 5029), 'UTIL.SYS.LOG', 'LOG', (['"""--- idle ---"""'], {}), "('--- idle ---')\n", (5013, 5029), False, 'from UTIL.SYS import Error, LOG, LOG_INFO, LOG_WARNING, LOG_ERROR\n'), ((5419, 5445), 'UTIL.SYS.LOG', 'LOG', (['"""Open the TCP server"""'], {}), "('Open the TCP server')\n", (5422, 5445), False, 'from UTIL....
yoavcaspi/pre-commit
tests/clientlib_test.py
77947f212e7b88a479dbe6feebc60a9f773e8c13
from __future__ import unicode_literals import logging import cfgv import pytest import pre_commit.constants as C from pre_commit.clientlib import check_type_tag from pre_commit.clientlib import CONFIG_HOOK_DICT from pre_commit.clientlib import CONFIG_REPO_DICT from pre_commit.clientlib import CONFIG_SCHEMA from pre...
[((805, 871), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""value"""', "('definitely-not-a-tag', 'fiel')"], {}), "('value', ('definitely-not-a-tag', 'fiel'))\n", (828, 871), False, 'import pytest\n'), ((992, 1697), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (["('config_obj', 'expected')", "(({'...
fetus-hina/IkaLog
ikalog/ui/options.py
bd476da541fcc296f792d4db76a6b9174c4777ad
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 Takeshi HASEGAWA # # 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/l...
[((1293, 1327), 'wx.Notebook', 'wx.Notebook', (['self.frame', 'wx.ID_ANY'], {}), '(self.frame, wx.ID_ANY)\n', (1304, 1327), False, 'import wx\n'), ((1776, 1802), 'wx.BoxSizer', 'wx.BoxSizer', (['wx.HORIZONTAL'], {}), '(wx.HORIZONTAL)\n', (1787, 1802), False, 'import wx\n'), ((1952, 1976), 'wx.BoxSizer', 'wx.BoxSizer', ...
CyberTKR/Simple-LINELIB
setup.py
8596afb6b201b13675a0ed6314b3151f6bbf208b
from setuptools import setup, find_packages with open("README.md", 'r',encoding="utf-8") as f: long_description = f.read() setup( name='LineBot', version='0.1.0', description='Simple-LINELIB', long_description=long_description, author='Tolg KR', author_email='tolgkr@cybertkr.com', url=...
[((379, 426), 'setuptools.find_packages', 'find_packages', ([], {'include': "['CyberTK', 'CyberTK.*']"}), "(include=['CyberTK', 'CyberTK.*'])\n", (392, 426), False, 'from setuptools import setup, find_packages\n')]
multi-service-fabric/element-manager
lib/SeparateDriver/CgwshDeviceDriverSetParameterECDB.py
e550d1b5ec9419f1fb3eb6e058ce46b57c92ee2f
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright(c) 2019 Nippon Telegraph and Telephone Corporation # Filename: CgwshDeviceDriverSetParameterECDB.py ''' Parameter module for Cgwsh driver configuration ''' import GlobalModule from EmCommonLog import decorater_log from DriverSetParameterECDB import Dr...
[((1321, 1391), 'GlobalModule.EM_LOGGER.debug', 'GlobalModule.EM_LOGGER.debug', (["('get management_info = %s' % (get_info,))"], {}), "('get management_info = %s' % (get_info,))\n", (1349, 1391), False, 'import GlobalModule\n'), ((2218, 2285), 'GlobalModule.EM_LOGGER.debug', 'GlobalModule.EM_LOGGER.debug', (["('get sta...
Bhaskers-Blu-Org1/wc-devops-utilities
scripts/common_lib/build_lib.py
d8131261cb3d67ce872b541c5e2d8ff22fcbf614
#!/usr/bin/env python3.6 import os import subprocess import json import argparse import zipfile import shutil import requests import datetime import re import operator import unicodedata # global list of error messages to keep track of all error msgs errorMessages = [] """ Collection of Common Functions used by Buil...
[((962, 1027), 'requests.get', 'requests.get', (['url'], {'auth': '(usr, pwd)', 'headers': 'headers', 'verify': '(False)'}), '(url, auth=(usr, pwd), headers=headers, verify=False)\n', (974, 1027), False, 'import requests\n'), ((1631, 1655), 'json.loads', 'json.loads', (['request.text'], {}), '(request.text)\n', (1641, ...
ivalab/GraspKpNet
src/static_grasp_kt.py
d4b6186d74ac82a745d778892742d52a204bd1cf
from __future__ import absolute_import from __future__ import division from __future__ import print_function import _init_paths import os import json import cv2 import cv2.aruco as aruco import numpy as np import sys import rospy from std_msgs.msg import Bool from std_msgs.msg import Float64MultiArray from sensor_ms...
[((721, 828), 'numpy.array', 'np.array', (['[[1.0, 0.0, 0.0, 0.3], [0.0, 1.0, 0.0, 0.32], [0.0, 0.0, 1.0, -0.045], [0.0,\n 0.0, 0.0, 1.0]]'], {}), '([[1.0, 0.0, 0.0, 0.3], [0.0, 1.0, 0.0, 0.32], [0.0, 0.0, 1.0, -\n 0.045], [0.0, 0.0, 0.0, 1.0]])\n', (729, 828), True, 'import numpy as np\n'), ((949, 1145), 'numpy....
dovietchinh/multi-task-classification
source/utils/augmentations.py
23a70300a7a800bc982f87902b6aa1faaf91b489
import numpy as np import cv2 import random def preprocess(img,img_size,padding=True): """[summary] Args: img (np.ndarray): images img_size (int,list,tuple): target size. eg: 224 , (224,224) or [224,224] padding (bool): padding img before resize. Prevent from image distortion. Default...
[((822, 847), 'cv2.resize', 'cv2.resize', (['img', 'img_size'], {}), '(img, img_size)\n', (832, 847), False, 'import cv2\n'), ((12747, 12769), 'cv2.imread', 'cv2.imread', (['"""test.jpg"""'], {}), "('test.jpg')\n", (12757, 12769), False, 'import cv2\n'), ((4304, 4324), 'numpy.clip', 'np.clip', (['img', '(0)', '(255)'],...
James992927108/uEFI_Edk2_Practice
BaseTools/Source/Python/GenFds/CapsuleData.py
2cac7618dfee10bfa5104a2e167c85425fde0100
## @file # generate capsule # # Copyright (c) 2007-2017, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be found a...
[((5358, 5389), 'os.path.getsize', 'os.path.getsize', (['self.ImageFile'], {}), '(self.ImageFile)\n', (5373, 5389), False, 'import os\n'), ((2439, 2494), 'GenFdsGlobalVariable.GenFdsGlobalVariable.ReplaceWorkspaceMacro', 'GenFdsGlobalVariable.ReplaceWorkspaceMacro', (['self.FvName'], {}), '(self.FvName)\n', (2481, 2494...
davidmallasen/Hello_MPI
CalculatingPi/pi_linear_plot.py
8a5b5694ffc1515d2bb2dee45355f92f1b68fbed
import matplotlib.pyplot as plt import numpy as np # Read data size = [] time = [] with open("pi_linear.txt") as file: for line in file.readlines(): x, y = line.split(',') size.append(int(x.strip())) time.append(float(y.strip())) # Plot data fig, ax = plt.subplots() ax.plot(size, tim...
[((288, 302), 'matplotlib.pyplot.subplots', 'plt.subplots', ([], {}), '()\n', (300, 302), True, 'import matplotlib.pyplot as plt\n'), ((442, 452), 'matplotlib.pyplot.show', 'plt.show', ([], {}), '()\n', (450, 452), True, 'import matplotlib.pyplot as plt\n')]
real-digital/esque-wire
esque_wire/protocol/structs/api/elect_preferred_leaders_response.py
eb02c49f38b89ad5e5d25aad15fb4ad795e52807
from typing import ClassVar, List, Optional from ...constants import ApiKey, ErrorCode from ..base import ResponseData class PartitionResult: partition_id: int error_code: ErrorCode error_message: Optional[str] def __init__(self, partition_id: int, error_code: ErrorCode, error_message: Optional[str...
[]
arthurlogilab/py_zipkin
tests/stack_test.py
8e733506c399967ea74c56b99a9a421e1bb1736a
import mock import pytest import py_zipkin.storage @pytest.fixture(autouse=True, scope="module") def create_zipkin_attrs(): # The following tests all expect _thread_local.zipkin_attrs to exist: if it # doesn't, mock.patch will fail. py_zipkin.storage.ThreadLocalStack().get() def test_get_zipkin_attrs_r...
[((55, 99), 'pytest.fixture', 'pytest.fixture', ([], {'autouse': '(True)', 'scope': '"""module"""'}), "(autouse=True, scope='module')\n", (69, 99), False, 'import pytest\n'), ((415, 471), 'mock.patch.object', 'mock.patch.object', (['tracer._context_stack', '"""_storage"""', '[]'], {}), "(tracer._context_stack, '_storag...
cp4cds/cp4cds-wps-template
myapp/processes/plotter.py
ed170fcee72146dc07c64f76ec71cc289672fd32
from pywps import Process, LiteralInput, ComplexInput, ComplexOutput from pywps import Format import logging LOGGER = logging.getLogger('PYWPS') import matplotlib # no X11 server ... must be run first # https://github.com/matplotlib/matplotlib/issues/3466/ matplotlib.use('Agg') import matplotlib.pylab as plt import...
[((120, 146), 'logging.getLogger', 'logging.getLogger', (['"""PYWPS"""'], {}), "('PYWPS')\n", (137, 146), False, 'import logging\n'), ((260, 281), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (274, 281), False, 'import matplotlib\n'), ((586, 603), 'netCDF4.Dataset', 'Dataset', (['resource'], {}...
zorgulle/json_schema_checker
json_schema_checker/composed/__init__.py
20cac68f899528619e5059f0e1fbee0a0f7219d6
from .composed import List from .composed import IntList
[]
jmigual/socialQuiz
backend/social_quiz.py
3d9d0980961619b555732899121d8ce6366fa96f
# -*- coding: utf-8 -*- import json import os.path import random import re from flask import Flask, send_from_directory from flask import request, abort from flaskrun.flaskrun import flask_run import datab.social_database as db app = Flask(__name__) # Regular expression to only accept certain files fileChecker = r...
[((238, 253), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (243, 253), False, 'from flask import Flask, send_from_directory\n'), ((319, 380), 're.compile', 're.compile', (['"""(.*\\\\.js|.*\\\\.html|.*\\\\.png|.*\\\\.css|.*\\\\.map)$"""'], {}), "('(.*\\\\.js|.*\\\\.html|.*\\\\.png|.*\\\\.css|.*\\\\.map)$...
aiven/astacus
astacus/node/snapshotter.py
2d64e1f33e01d50a41127f41d9da3d1ab0ce0387
""" Copyright (c) 2020 Aiven Ltd See LICENSE for details """ from astacus.common import magic, utils from astacus.common.ipc import SnapshotFile, SnapshotHash, SnapshotState from astacus.common.progress import increase_worth_reporting, Progress from pathlib import Path from typing import Optional import base64 impo...
[((383, 410), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (400, 410), False, 'import logging\n'), ((1794, 1803), 'pathlib.Path', 'Path', (['src'], {}), '(src)\n', (1798, 1803), False, 'from pathlib import Path\n'), ((1823, 1832), 'pathlib.Path', 'Path', (['dst'], {}), '(dst)\n', (1827,...
richiware/colcon-gradle
colcon_gradle/task/gradle/build.py
00b121def8c15abd1dca310d0ea4e1f34f98f4d1
# Copyright 2018 Esteve Fernandez # Licensed under the Apache License, Version 2.0 from distutils import dir_util import glob import os from pathlib import Path import shutil from colcon_core.environment import create_environment_scripts from colcon_core.logging import colcon_logger from colcon_core.plugin_system imp...
[((720, 752), 'colcon_core.logging.colcon_logger.getChild', 'colcon_logger.getChild', (['__name__'], {}), '(__name__)\n', (742, 752), False, 'from colcon_core.logging import colcon_logger\n'), ((905, 974), 'colcon_core.plugin_system.satisfies_version', 'satisfies_version', (['TaskExtensionPoint.EXTENSION_POINT_VERSION'...
eladc-git/model_optimization
model_compression_toolkit/keras/quantizer/gradient_ptq/utils.py
46d1c893ca23e61d8ef7597184ad2ba6e2ae6e7a
# Copyright 2021 Sony Semiconductors Israel, Inc. 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 b...
[((1244, 1258), 'tensorflow.math.log', 'tf.math.log', (['x'], {}), '(x)\n', (1255, 1258), True, 'import tensorflow as tf\n'), ((1261, 1277), 'tensorflow.math.log', 'tf.math.log', (['(2.0)'], {}), '(2.0)\n', (1272, 1277), True, 'import tensorflow as tf\n'), ((931, 946), 'tensorflow.math.ceil', 'tf.math.ceil', (['x'], {}...
btashton/pygments
pygments/lexers/tnt.py
ceaad0372055ed0064121020fea032fdda429779
# -*- coding: utf-8 -*- """ pygments.lexers.tnt ~~~~~~~~~~~~~~~~~~~ Lexer for Typographic Number Theory. :copyright: Copyright 2019-2020 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer from pygments.token import Text, Commen...
[((1048, 1460), 're.compile', 're.compile', (['"""(?xi)\n joining | separation | double-tilde | fantasy\\\\ rule\n | carry[- ]over(?:\\\\ of)?(?:\\\\ line)?\\\\ ([0-9]+) | detachment\n | contrapositive | De\\\\ Morgan | switcheroo\n | specification | generalization | interchange\n | e...
cheradenine/Django-CRM
contacts/urls.py
692572ced050d314c1f880af8b4000c97cbf7440
from django.urls import path from contacts.views import ( ContactsListView, CreateContactView, ContactDetailView, UpdateContactView, RemoveContactView, GetContactsView, AddCommentView, UpdateCommentView, DeleteCommentView, AddAttachmentsView, DeleteAttachmentsView) app_name = 'contacts' urlpatterns =...
[((341, 367), 'contacts.views.ContactsListView.as_view', 'ContactsListView.as_view', ([], {}), '()\n', (365, 367), False, 'from contacts.views import ContactsListView, CreateContactView, ContactDetailView, UpdateContactView, RemoveContactView, GetContactsView, AddCommentView, UpdateCommentView, DeleteCommentView, AddAt...
marpie/PythonForWindows
windows/winobject/network.py
b253bc5873e7d97087ed22f2753b51fc6880ec18
import windows import ctypes import socket import struct from windows import winproxy import windows.generated_def as gdef from windows.com import interfaces as cominterfaces from windows.generated_def.winstructs import * from windows.generated_def.windef import * class TCP4Connection(MIB_TCPROW_OWNER_PID): """A...
[((4444, 4519), 'windows.generated_def.winstructs.MIB_TCPTABLE_OWNER_PID.from_buffer', 'windows.generated_def.winstructs.MIB_TCPTABLE_OWNER_PID.from_buffer', (['buffer'], {}), '(buffer)\n', (4511, 4519), False, 'import windows\n'), ((4877, 4953), 'windows.generated_def.winstructs.MIB_TCP6TABLE_OWNER_PID.from_buffer', '...
Bhare8972/LOFAR-LIM
LIM_scripts/func_curry.py
89f25be8c02cb8980c2e237da3eaac279d40a06a
#!/usr/bin/env python3 # Coded by Massimiliano Tomassoli, 2012. # # - Thanks to b49P23TIvg for suggesting that I should use a set operation # instead of repeated membership tests. # - Thanks to Ian Kelly for pointing out that # - "minArgs = None" is better than "minArgs = -1", # - "if args" is better than ...
[]
Ewpratten/chat
src/messages.py
4cc8461e442b6530b7874f234b1a2261f3db8456
greeting = """ --------------- BEGIN SESSION --------------- You have connected to a chat server. Welcome! :: About Chat is a small piece of server software written by Evan Pratten to allow people to talk to eachother from any computer as long as it has an internet connection. (Even an arduino!). Check out the proje...
[]
khayam-hafezi/CRNN-keras-persian
Prediction.py
3f99838e5b3b0e0ca79899e25b0648940b7fdfac
import cv2 import itertools, os, time import numpy as np from Model import get_Model from parameter import letters import argparse from keras import backend as K K.set_learning_phase(0) Region = {"A": "서울 ", "B": "경기 ", "C": "인천 ", "D": "강원 ", "E": "충남 ", "F": "대전 ", "G": "충북 ", "H": "부산 ", "I": "울산 ", "J": ...
[((162, 185), 'keras.backend.set_learning_phase', 'K.set_learning_phase', (['(0)'], {}), '(0)\n', (182, 185), True, 'from keras import backend as K\n'), ((1555, 1580), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (1578, 1580), False, 'import argparse\n'), ((1889, 1914), 'Model.get_Model', 'ge...
OswinC/torcharrow
torcharrow/_interop.py
45a57c45afeffee488c51e3387179292b3504a6c
# Copyright (c) Facebook, Inc. and its affiliates. from typing import List, Optional, cast # Skipping analyzing 'numpy': found module but no type hints or library stubs import numpy as np # type: ignore import numpy.ma as ma # type: ignore # Skipping analyzing 'pandas': found module but no type hints or library stu...
[((5363, 5396), 'torcharrow.dtypes.is_boolean_or_numerical', 'dt.is_boolean_or_numerical', (['dtype'], {}), '(dtype)\n', (5389, 5396), True, 'import torcharrow.dtypes as dt\n'), ((6246, 6279), 'torcharrow.dtypes.is_boolean_or_numerical', 'dt.is_boolean_or_numerical', (['dtype'], {}), '(dtype)\n', (6272, 6279), True, 'i...
jdavidagudelo/tensorflow-models
research/gan/image_compression/eval.py
6f019beec73b01861363bf717706e27f4210b979
# Copyright 2017 The TensorFlow 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...
[((2633, 2707), 'research.gan.image_compression.summaries.add_reconstruction_summaries', 'summaries.add_reconstruction_summaries', (['images', 'reconstructions', 'prebinary'], {}), '(images, reconstructions, prebinary)\n', (2671, 2707), False, 'from research.gan.image_compression import summaries\n'), ((2853, 2891), 't...
CheyenneNS/metrics
source/dump_query_results.py
cfeeac6d01d99679897a998b193d630ada169c61
#!/usr/local/bin/python import os import mysql.connector as mysql metrics_mysql_password = os.environ['METRICS_MYSQL_PWD'] sql_host = os.environ['SQL_HOST'] metrics = os.environ['QUERY_ON'] def dump_query_results(): """ This is a simple SQL table dump of a given query so we can supply users with custom ...
[((643, 742), 'mysql.connector.connect', 'mysql.connect', ([], {'host': 'sql_host', 'user': '"""metrics"""', 'passwd': 'metrics_mysql_password', 'database': '"""metrics"""'}), "(host=sql_host, user='metrics', passwd=metrics_mysql_password,\n database='metrics')\n", (656, 742), True, 'import mysql.connector as mysql\...
UAEKondaya1/expressvpn_leak_testing
desktop_local_tests/windows/test_windows_packet_capture_disrupt_force_public_dns_servers.py
9e4cee899ac04f7820ac351fa55efdc0c01370ba
from desktop_local_tests.local_packet_capture_test_case_with_disrupter import LocalPacketCaptureTestCaseWithDisrupter from desktop_local_tests.windows.windows_dns_force_public_dns_servers_disrupter import WindowsDNSForcePublicDNSServersDisrupter class TestWindowsPacketCaptureDisruptForcePublicDNSServers(LocalPacketCap...
[]
geojeff/kivy
kivy/loader.py
25ab20e5b0e87269531abe1f8cc76bf270bcc755
''' Asynchronous data loader ======================== This is the Asynchronous Loader. You can use it to load an image and use it, even if data are not yet available. You must specify a default loading image for using a such loader:: from kivy import * image = Loader.image('mysprite.png') You can also load i...
[((1379, 1429), 'kivy.cache.Cache.register', 'Cache.register', (['"""kv.loader"""'], {'limit': '(500)', 'timeout': '(60)'}), "('kv.loader', limit=500, timeout=60)\n", (1393, 1429), False, 'from kivy.cache import Cache\n'), ((2461, 2482), 'threading.Condition', 'threading.Condition', ([], {}), '()\n', (2480, 2482), Fals...
Pythobit/Python-tutorial
Season 01 - Intro to Python/Episode 13 - Join.py
b0743eaa9c237c3578131ead1b3f2c295f11b7ee
# 13. Join # it allows to print list a bit better friends = ['Pythobit','boy','Pythoman'] print(f'My friends are {friends}.') # Output - My friends are ['Pythobit', 'boy', 'Pythoman']. # So, the Output needs to be a bit clearer. friends = ['Pythobit','boy','Pythoman'] friend = ', '.join(friends) print(f'My friend...
[]
randomizax/polygon-label
buildsettings.py
5091bd54aee5166d418b240f34d7a5c336685c06
# settings file for builds. # if you want to have custom builds, copy this file to "localbuildsettings.py" and make changes there. # possible fields: # resourceBaseUrl - optional - the URL base for external resources (all resources embedded in standard IITC) # distUrlBase - optional - the base URL to use for update c...
[]
riverma/osaka
osaka/storage/sftp.py
f9ed386936500303c629d7213d91215085bcf346
from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from builtins import int from future import standard_library standard_library.install_aliases() import os import os.path import stat import urllib.parse import paramiko...
[((213, 247), 'future.standard_library.install_aliases', 'standard_library.install_aliases', ([], {}), '()\n', (245, 247), False, 'from future import standard_library\n'), ((1354, 1381), 'paramiko.client.SSHClient', 'paramiko.client.SSHClient', ([], {}), '()\n', (1379, 1381), False, 'import paramiko\n'), ((2909, 2922),...
heavenlysf/thesis
thesis/pettingzoo/butterfly/cooperative_pong/cake_paddle.py
646553c45860f337c91a48ab7f666a174784472f
import os os.environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "hide" import pygame RENDER_RATIO = 2 class CakePaddle(pygame.sprite.Sprite): def __init__(self, speed=12): # surf is the right-most (largest) tier of the cake self.surf = pygame.Surface((30 // RENDER_RATIO, 120 // RENDER_RATIO)) self....
[((249, 306), 'pygame.Surface', 'pygame.Surface', (['(30 // RENDER_RATIO, 120 // RENDER_RATIO)'], {}), '((30 // RENDER_RATIO, 120 // RENDER_RATIO))\n', (263, 306), False, 'import pygame\n'), ((369, 425), 'pygame.Surface', 'pygame.Surface', (['(30 // RENDER_RATIO, 80 // RENDER_RATIO)'], {}), '((30 // RENDER_RATIO, 80 //...
aidkilda/understanding-drl-navigation
src/internal_representation_analysis/decoder/StateDataset.py
0d637c2390a935ec1182d4f2d5165644d98d6404
import random from internal_representation_analysis.network import ActorCriticFFNetwork from internal_representation_analysis.scene_loader import THORDiscreteEnvironment as Environment from internal_representation_analysis.constants import MINI_BATCH_SIZE class StateDataset(object): def __init__(self, states): ...
[((659, 676), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (670, 676), False, 'import random\n'), ((685, 711), 'random.shuffle', 'random.shuffle', (['all_states'], {}), '(all_states)\n', (699, 711), False, 'import random\n'), ((1815, 1845), 'random.shuffle', 'random.shuffle', (['self.train_set'], {}), '(se...
ferrine/PerceptualSimilarity
test_dataset_model.py
2ff66e86b12dbfbc337991def71b09e3b86d4b12
import numpy as np from models import dist_model as dm from data import data_loader as dl import argparse from IPython import embed parser = argparse.ArgumentParser() parser.add_argument("--dataset_mode", type=str, default="2afc", help="[2afc,jnd]") parser.add_argument( "--datasets", type=str, nargs="+", ...
[((142, 167), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (165, 167), False, 'import argparse\n'), ((2041, 2055), 'models.dist_model.DistModel', 'dm.DistModel', ([], {}), '()\n', (2053, 2055), True, 'from models import dist_model as dm\n'), ((2690, 2781), 'data.data_loader.CreateDataLoader',...
StrangeTcy/pathnet-pytorch
plotter.py
58c8088b992ad2f36b843186d93edc872d547c7b
import argparse import os import pickle import numpy as np import matplotlib.pyplot as plt plt.style.use('ggplot') parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--mnist', action='store_true', default=False, help='open mnist result') args = parser.parse_a...
[((91, 114), 'matplotlib.pyplot.style.use', 'plt.style.use', (['"""ggplot"""'], {}), "('ggplot')\n", (104, 114), True, 'import matplotlib.pyplot as plt\n'), ((125, 185), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch MNIST Example"""'}), "(description='PyTorch MNIST Example')\n",...
mingruimingrui/kindler
kindler/solver/optimizer.py
8a9c2278b607a167b0ce827b218e54949a1120e7
import torch def make_sgd_optimizer( model, base_lr=0.001, bias_lr_factor=2.0, momentum=0.9, weight_decay=0.0005, weight_decay_bias=0.0, ): params = [] for key, value in model.named_parameters(): if not value.requires_grad: continue param_lr = base_lr ...
[((642, 693), 'torch.optim.SGD', 'torch.optim.SGD', (['params', 'base_lr'], {'momentum': 'momentum'}), '(params, base_lr, momentum=momentum)\n', (657, 693), False, 'import torch\n')]
sctiwari/EZFF_ASE
platypus/tests/test_operators.py
94710d4cf778ff2db5e6df0cd6d10d92e1b98afe
# Copyright 2015-2018 David Hadka # # This file is part of Platypus, a Python module for designing and using # evolutionary algorithms (EAs) and multiobjective evolutionary algorithms # (MOEAs). # # Platypus is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License a...
[((1222, 1267), 'mock.patch', 'patch', (['"""random.randrange"""'], {'side_effect': '[2, 4]'}), "('random.randrange', side_effect=[2, 4])\n", (1227, 1267), False, 'from mock import patch\n'), ((1770, 1815), 'mock.patch', 'patch', (['"""random.randrange"""'], {'side_effect': '[0, 1]'}), "('random.randrange', side_effect...
ClovisChen/LearningCNN
fusion_net/bilinear_sampler.py
cd9102a3d71f602024558d818039f5b759c92fa5
#!/usr/bin/env python # -*- coding: utf-8 -*-are not covered by the UCLB ACP-A Licence, from __future__ import absolute_import, division, print_function import tensorflow as tf def bilinear_sampler_1d_h(input_images, x_offset, wrap_mode='border', name='bilinear_sampler', **kwargs): ''' 一维双线性采样: x_offset--输入X上...
[((5737, 5760), 'tensorflow.variable_scope', 'tf.variable_scope', (['name'], {}), '(name)\n', (5754, 5760), True, 'import tensorflow as tf\n'), ((6056, 6084), 'tensorflow.cast', 'tf.cast', (['_height', 'tf.float32'], {}), '(_height, tf.float32)\n', (6063, 6084), True, 'import tensorflow as tf\n'), ((6105, 6132), 'tenso...
adamamiller/iptf16hvw-1
Supernovae.py
d674114e94b5b20398d2e4208b55eb8e2394dce9
#import relevant libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from astropy.io import ascii import json from IPython.display import display, Image from specutils import Spectrum1D from astropy import units from scipy.optimize import curve_fit from scipy.interpolate import interp1d imp...
[((5056, 5070), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (5068, 5070), True, 'import pandas as pd\n'), ((5980, 5995), 'json.load', 'json.load', (['file'], {}), '(file)\n', (5989, 5995), False, 'import json\n'), ((6067, 6089), 'numpy.array', 'np.array', (['spectra_data'], {}), '(spectra_data)\n', (6075, 608...
iraqis1/irqis
userbot/plugins/alive.py
d95303c48b5f15dbe814454a48d847e838793713
"""Check if userbot alive. If you change these, you become the gayest gay such that even the gay world will disown you.""" import asyncio from telethon import events from telethon.tl.types import ChannelParticipantsAdmins from platform import uname from userbot import ALIVE_NAME from userbot.utils import admin_cm...
[]
qiutongxue/ArknightsAutoHelper
connector/ADBConnector.py
6b97b289e9ea4e5e3f39561ef8c2217657f6ff60
import os import logging.config from random import randint import zlib import struct import socket import time from PIL import Image import config # from config import ADB_ROOT, ADB_HOST, SCREEN_SHOOT_SAVE_PATH, ShellColor, CONFIG_PATH,enable_adb_host_auto_detect, ADB_SERVER from .ADBClientSession import ADBClientSes...
[((529, 568), 'PIL.Image.frombytes', 'Image.frombytes', (['"""RGBA"""', '(w, h)', 'pixels'], {}), "('RGBA', (w, h), pixels)\n", (544, 568), False, 'from PIL import Image\n'), ((684, 705), 'PIL.Image.open', 'Image.open', (['imgorfile'], {}), '(imgorfile)\n', (694, 705), False, 'from PIL import Image\n'), ((1186, 1223), ...
douglassimonsen/redshift_upload
redshift_upload/base_utilities.py
e549c770538f022c0b90a983ca056f3e9c16c643
import inspect import os from pathlib import Path class change_directory: """ A class for changing the working directory using a "with" statement. It takes the directory to change to as an argument. If no directory is given, it takes the directory of the file from which this function was call...
[((415, 426), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (424, 426), False, 'import os\n'), ((659, 681), 'os.chdir', 'os.chdir', (['self.new_dir'], {}), '(self.new_dir)\n', (667, 681), False, 'import os\n'), ((730, 752), 'os.chdir', 'os.chdir', (['self.old_dir'], {}), '(self.old_dir)\n', (738, 752), False, 'import os\...
Gloriel621/MgallManager
main.py
7d5c02ab6bdc2f6c6922d4a7e021faef33d868bb
import sys from PyQt5.QtWidgets import QApplication from gui import MgallManager def main(): app = QApplication(sys.argv) ex = MgallManager() app.aboutToQuit.connect(ex.ExitHandler) sys.exit(app.exec_()) if __name__ == "__main__": main()
[((106, 128), 'PyQt5.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (118, 128), False, 'from PyQt5.QtWidgets import QApplication\n'), ((138, 152), 'gui.MgallManager', 'MgallManager', ([], {}), '()\n', (150, 152), False, 'from gui import MgallManager\n')]
dh256/adventofcode
utils/src/adventofcode/utils/Point3D.py
428eec13f4cbf153333a0e359bcff23070ef6d27
class Point3D: def __init__(self,x,y,z): self.x = x self.y = y self.z = z ''' Returns the distance between two 3D points ''' def distance(self, value): return abs(self.x - value.x) + abs(self.y - value.y) + abs(self.z - value.z) def __eq__(self, value): ...
[]
javierrcc522/starcraft2_api_machineLear
pysc2/lib/actions.py
5833ba1344ab5445c4f09fafc33e6058070ebe6c
# Copyright 2017 Google Inc. 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 ...
[((3975, 4044), 'collections.namedtuple', 'collections.namedtuple', (['"""ArgumentType"""', "['id', 'name', 'sizes', 'fn']"], {}), "('ArgumentType', ['id', 'name', 'sizes', 'fn'])\n", (3997, 4044), False, 'import collections\n'), ((5264, 5515), 'collections.namedtuple', 'collections.namedtuple', (['"""Arguments"""', "[...
ashishpatel26/pywick
pywick/meters/aucmeter.py
1afffd1c21c2b188836d3599e802146182757bb5
import numbers from . import meter import numpy as np import torch class AUCMeter(meter.Meter): """ The AUCMeter measures the area under the receiver-operating characteristic (ROC) curve for binary classification problems. The area under the curve (AUC) can be interpreted as the probability that, give...
[((1309, 1332), 'torch.is_tensor', 'torch.is_tensor', (['output'], {}), '(output)\n', (1324, 1332), False, 'import torch\n'), ((1397, 1420), 'torch.is_tensor', 'torch.is_tensor', (['target'], {}), '(target)\n', (1412, 1420), False, 'import torch\n'), ((1991, 2021), 'numpy.append', 'np.append', (['self.scores', 'output'...
liangleslie/core
homeassistant/components/zha/core/channels/lighting.py
cc807b4d597daaaadc92df4a93c6e30da4f570c6
"""Lighting channels module for Zigbee Home Automation.""" from __future__ import annotations from contextlib import suppress from zigpy.zcl.clusters import lighting from .. import registries from ..const import REPORT_CONFIG_DEFAULT from .base import ClientChannel, ZigbeeChannel @registries.ZIGBEE_CHANNEL_REGISTR...
[((1482, 1500), 'contextlib.suppress', 'suppress', (['KeyError'], {}), '(KeyError)\n', (1490, 1500), False, 'from contextlib import suppress\n')]
PiRAT4/py-pf
pf/queue.py
7ffdd0a283d4a36fc4c473433d5f79a84eeb5d31
"""Classes to represent Packet Filter's queueing schedulers and statistics.""" import pf._struct from pf._base import PFObject from pf.constants import * from pf._utils import rate2str __all__ = ["ServiceCurve", "FlowQueue", "PFQueue", "PFQueueStats"] class ServiceCurve(PFObject): ...
[((1594, 1606), 'pf._utils.rate2str', 'rate2str', (['bw'], {}), '(bw)\n', (1602, 1606), False, 'from pf._utils import rate2str\n')]
pulumi-bot/pulumi-azure-native
sdk/python/pulumi_azure_native/labservices/v20181015/__init__.py
f7b9490b5211544318e455e5cceafe47b628e12c
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** # Export this package's modules as members: from ._enums import * from .environment import * from .environment_setting import * from .gallery_image imp...
[((2259, 2361), 'pulumi.runtime.register_resource_module', 'pulumi.runtime.register_resource_module', (['"""azure-native"""', '"""labservices/v20181015"""', '_module_instance'], {}), "('azure-native',\n 'labservices/v20181015', _module_instance)\n", (2298, 2361), False, 'import pulumi\n'), ((1382, 1413), 'pulumi.Res...
ealogar/servicedirectory
servicedirectory/src/sd-api/users/tests/tests_serializers.py
fb4f4bfa8b499b93c03af589ef2f34c08a830b17
''' (c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights Reserved. The copyright to the software program(s) is property of Telefonica I+D. The program(s) may be used and or copied only with the express written consent of Telefonica I+D or in accordance with the terms and conditions stipulated in t...
[((790, 828), 'mock.MagicMock', 'MagicMock', ([], {'name': '"""mock_schema_instance"""'}), "(name='mock_schema_instance')\n", (799, 828), False, 'from mock import MagicMock, patch\n'), ((1156, 1189), 'mock.MagicMock', 'MagicMock', ([], {'name': '"""mock_get_schema"""'}), "(name='mock_get_schema')\n", (1165, 1189), Fals...
abs0lut3pwn4g3/RootersCTF2019-challenges
Web/notifyXAPI/app/src/users/views.py
397a6fad0b03e55541df06e5103172ae850cd4e5
''' User views ''' from datetime import timedelta from flask import request, jsonify, make_response, redirect, json, render_template from flask_jwt_extended import (create_access_token, jwt_required) from flask_restful import Resource from flask_login import login_user, current_user from sqlalchemy.exc import Integrit...
[((2986, 3050), 'src.api.add_resource', 'api.add_resource', (['UserLoginResource', '"""/login/"""'], {'endpoint': '"""login"""'}), "(UserLoginResource, '/login/', endpoint='login')\n", (3002, 3050), False, 'from src import db, api\n'), ((3051, 3124), 'src.api.add_resource', 'api.add_resource', (['UserRegisterResource',...
wesokes/django-query-builder
querybuilder/tests/window_tests.py
3cc53d33ee0a4ada515635e4be631167a774b457
from querybuilder.fields import ( RankField, RowNumberField, DenseRankField, PercentRankField, CumeDistField, NTileField, LagField, LeadField, FirstValueField, LastValueField, NthValueField, NumStdDevField ) from querybuilder.query import QueryWindow, Query from querybuilder.tests.models import Order from query...
[((483, 496), 'querybuilder.query.QueryWindow', 'QueryWindow', ([], {}), '()\n', (494, 496), False, 'from querybuilder.query import QueryWindow, Query\n'), ((627, 672), 'querybuilder.tests.query_tests.get_comparison_str', 'get_comparison_str', (['query_str', 'expected_query'], {}), '(query_str, expected_query)\n', (645...
wbprice/ojimoji
emoji/coffee.py
7b1a8b5ed0062d1d52e151e7412e1131e3de7924
import numpy h = .25 s = 1 bitmap = numpy.array([ [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0], [0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0], [0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0], [0,0,1,1,1,0,1,0,1,1,1,0,0,1,0,0], [0,0,1,1,0,1,0,1,0,1,1,0,0,1,0,...
[((37, 899), 'numpy.array', 'numpy.array', (['[[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \n 0], [0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 0, 0], [0, 0, ...
gkfthddk/keras
dumpcode/npzbdt.py
46d96c65d69c39df298800336bbb4d867a2561fb
import numpy as np from sklearn.model_selection import RandomizedSearchCV, GridSearchCV from sklearn.metrics import roc_auc_score from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import KFold import scipy.stats as sts import xgboost as xgb from xiter import * import pandas as pd import a...
[((727, 752), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (750, 752), False, 'import argparse\n'), ((2254, 2324), 'xgboost.XGBClassifier', 'xgb.XGBClassifier', ([], {'objective': '"""binary:logistic"""', 'tree_method': '"""gpu_hist"""'}), "(objective='binary:logistic', tree_method='gpu_hist'...
watchsea/RL-Stock
rlenv/StockTradingEnv0.py
53bd13a1bd1760e082c6db2ad9b010adbc3a767b
import random import json import gym from gym import spaces import pandas as pd import numpy as np MAX_ACCOUNT_BALANCE = 2147483647 MAX_NUM_SHARES = 2147483647 MAX_SHARE_PRICE = 5000 MAX_VOLUME = 1000e8 MAX_AMOUNT = 3e10 MAX_OPEN_POSITIONS = 5 MAX_STEPS = 20000 MAX_DAY_CHANGE = 1 INITIAL_ACCOUNT_BALANCE = 10000 DATA...
[((1340, 1415), 'gym.spaces.Box', 'spaces.Box', ([], {'low': '(0)', 'high': '(1)', 'shape': '(DATA_HIS_PERIOD + 1, 6)', 'dtype': 'np.float16'}), '(low=0, high=1, shape=(DATA_HIS_PERIOD + 1, 6), dtype=np.float16)\n', (1350, 1415), False, 'from gym import spaces\n'), ((1501, 2058), 'numpy.array', 'np.array', (["[self.df....
mrfleap/us-population-heatmap
processing/manager.py
e3f1c5d8294716ff491c7b8b40adb77929f9aeee
import json import os import pathlib import time from tqdm import tqdm from aggregator import aggregate from download import DOWNLOAD_PATH, download_files, unzip_files from tqdm.contrib.concurrent import process_map def main(): start = time.time() # print("Downloading files...") # download_files() #...
[((243, 254), 'time.time', 'time.time', ([], {}), '()\n', (252, 254), False, 'import time\n'), ((410, 435), 'os.listdir', 'os.listdir', (['DOWNLOAD_PATH'], {}), '(DOWNLOAD_PATH)\n', (420, 435), False, 'import os\n'), ((839, 850), 'time.time', 'time.time', ([], {}), '()\n', (848, 850), False, 'import time\n'), ((1265, 1...
kshoji6011/vehicleai
gen_data.py
135de71cce65f4a61b42c49493ed356f2d512d6c
from PIL import Image import os, glob import numpy as np from sklearn import model_selection classes = ["car", "bycycle", "motorcycle", "pedestrian"] num_class = len(classes) image_size = 50 # 画像の読み込み X = [] Y = [] for index, classlabel in enumerate(classes): photos_dir = "./" + classlabel files = glob.glob...
[((623, 634), 'numpy.array', 'np.array', (['X'], {}), '(X)\n', (631, 634), True, 'import numpy as np\n'), ((639, 650), 'numpy.array', 'np.array', (['Y'], {}), '(Y)\n', (647, 650), True, 'import numpy as np\n'), ((687, 725), 'sklearn.model_selection.train_test_split', 'model_selection.train_test_split', (['X', 'Y'], {})...
immortel32/Sword_Sorcery_Story_Generator
app/main.py
7978dfc335813362b2d94c455b970f58421123c8
from services import waypoint_scenarios, quest_scenarios from services.build_campaign import Campaign from log_setup import log if __name__ == "__main__": number_waypoint_scenario = waypoint_scenarios.get_number_of_waypoint_scenarios() log.info(f"We have {number_waypoint_scenario} waypoint available") numb...
[((187, 240), 'services.waypoint_scenarios.get_number_of_waypoint_scenarios', 'waypoint_scenarios.get_number_of_waypoint_scenarios', ([], {}), '()\n', (238, 240), False, 'from services import waypoint_scenarios, quest_scenarios\n'), ((245, 311), 'log_setup.log.info', 'log.info', (['f"""We have {number_waypoint_scenario...
mbargull/conda-build
tests/test-recipes/metadata/ignore_some_prefix_files/run_test.py
ebc56f48196774301863fecbe98a32a7ded6eb7e
import os pkgs = os.path.join(os.environ["ROOT"], "pkgs") info_dir = os.path.join(pkgs, "conda-build-test-ignore-some-prefix-files-1.0-0", "info") has_prefix_file = os.path.join(info_dir, "has_prefix") print(info_dir) assert os.path.isfile(has_prefix_file) with open(has_prefix_file) as f: assert "test2" not in f.r...
[((18, 58), 'os.path.join', 'os.path.join', (["os.environ['ROOT']", '"""pkgs"""'], {}), "(os.environ['ROOT'], 'pkgs')\n", (30, 58), False, 'import os\n'), ((70, 147), 'os.path.join', 'os.path.join', (['pkgs', '"""conda-build-test-ignore-some-prefix-files-1.0-0"""', '"""info"""'], {}), "(pkgs, 'conda-build-test-ignore-s...
Lukeming-tsinghua/Interpretable-NN-for-IBD-diagnosis
distill.py
5fb0fae774e010cdd6b63ff487a4528f0397647d
import os from collections import namedtuple import torch import torch.nn as nn import torch.nn.functional as F from sklearn.metrics import classification_report from torch.optim import Adam from tqdm import tqdm from data import DataIteratorDistill from loss import FocalLoss from model import CNN from torchtext impo...
[((558, 568), 'args.get_args', 'get_args', ([], {}), '()\n', (566, 568), False, 'from args import get_args, print_args\n'), ((573, 589), 'args.print_args', 'print_args', (['args'], {}), '(args)\n', (583, 589), False, 'from args import get_args, print_args\n'), ((810, 845), 'torch.device', 'torch.device', (["('cuda:%d' ...
janbrohl/SimpleTAL
tests/TALTests/HTMLTests/TALAttributesTestCases.py
f5a3ddd9a74cf9af7356bb431513e3534717802d
#!/usr/bin/python # -*- coding: iso-8859-1 -*- # Copyright (c) 2016, Jan Brohl <janbrohl@t-online.de> # All rights reserved. # See LICENSE.txt # Copyright (c) 2004 Colin Stewart (http://www.owlfish.com/) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
[((1961, 1990), 'os.path.exists', 'os.path.exists', (['"""logging.ini"""'], {}), "('logging.ini')\n", (1975, 1990), False, 'import os\n'), ((1997, 2037), 'logging.config.fileConfig', 'logging.config.fileConfig', (['"""logging.ini"""'], {}), "('logging.ini')\n", (2022, 2037), False, 'import logging\n'), ((2048, 2069), '...
EBI-Metagenomics/iseq-prof
iseq_prof/fasta.py
ca41a0f3aa1e70e59648bdc08b36da1ec76220ad
from pathlib import Path from typing import List from fasta_reader import FASTAItem, FASTAWriter, read_fasta __all__ = ["downsample"] def downsample(infile: Path, outfile: Path, size: int, random): targets: List[FASTAItem] = list(read_fasta(infile)) if size > len(targets): raise ValueError("Size is ...
[((238, 256), 'fasta_reader.read_fasta', 'read_fasta', (['infile'], {}), '(infile)\n', (248, 256), False, 'from fasta_reader import FASTAItem, FASTAWriter, read_fasta\n'), ((436, 456), 'fasta_reader.FASTAWriter', 'FASTAWriter', (['outfile'], {}), '(outfile)\n', (447, 456), False, 'from fasta_reader import FASTAItem, FA...
DhruvSrikanth/TSLA-React
src/data_settings.py
2ce4edb6b21ec1a301047124cfda5bb30deb3a90
# API keys # YF_API_KEY = "YRVHVLiFAt3ANYZf00BXr2LHNfZcgKzdWVmsZ9Xi" # yahoo finance api key TICKER = "TSLA" INTERVAL = "1m" PERIOD = "1d" LOOK_BACK = 30 # hard limit to not reach rate limit of 100 per day
[]
phoenix-xhuang/ymir
ymir/backend/src/ymir_controller/controller/utils/invoker_mapping.py
537d3ac389c4a365ce4daef431c95b42ddcd5b1b
from controller.invoker import ( invoker_cmd_branch_checkout, invoker_cmd_branch_commit, invoker_cmd_branch_create, invoker_cmd_branch_delete, invoker_cmd_branch_list, invoker_cmd_evaluate, invoker_cmd_filter, invoker_cmd_gpu_info, invoker_cmd_inference, invoker_cmd_init, inv...
[]
asuol/worky
tests/utils/date_utils.py
362257e77486af05941cc977055c01e49b09a2dd
from datetime import datetime, timedelta due_date_format = '%Y-%m-%d' datepicker_date_format = '%m%d%Y' def current_date(): return datetime.utcnow().strftime(due_date_format) def datepicker_current_date(): return datetime.utcnow().strftime(datepicker_date_format) def _date_from_today(days_to_add): r...
[((326, 343), 'datetime.datetime.utcnow', 'datetime.utcnow', ([], {}), '()\n', (341, 343), False, 'from datetime import datetime, timedelta\n'), ((346, 373), 'datetime.timedelta', 'timedelta', ([], {'days': 'days_to_add'}), '(days=days_to_add)\n', (355, 373), False, 'from datetime import datetime, timedelta\n'), ((139,...
luk-f-a/numba
numba/roc/tests/hsapy/test_gufuncbuilding.py
3a682bd827e416335e3574bc7b10f0ec69adb701
import numpy as np from numba.roc.vectorizers import HsaGUFuncVectorize from numba.roc.dispatch import HSAGenerializedUFunc from numba import guvectorize import unittest def ufunc_add_core(a, b, c): for i in range(c.size): c[i] = a[i] + b[i] class TestGUFuncBuilding(unittest.TestCase): def test_guf...
[((5288, 5303), 'unittest.main', 'unittest.main', ([], {}), '()\n', (5301, 5303), False, 'import unittest\n'), ((357, 407), 'numba.roc.vectorizers.HsaGUFuncVectorize', 'HsaGUFuncVectorize', (['ufunc_add_core', '"""(x),(x)->(x)"""'], {}), "(ufunc_add_core, '(x),(x)->(x)')\n", (375, 407), False, 'from numba.roc.vectorize...
SRM-IST-KTR/ossmosis
server/form/mongo.py
06e375dfdd67f91286ffbcb13e04b6543585d8ad
import os from pymongo import MongoClient from dotenv import load_dotenv def database_entry(data): try: load_dotenv() mongo_string = os.getenv('MONGODB_AUTH_URI') client = MongoClient(mongo_string) database = client[os.getenv('MONGODB_DB')] col = database['users'] c...
[((118, 131), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (129, 131), False, 'from dotenv import load_dotenv\n'), ((155, 184), 'os.getenv', 'os.getenv', (['"""MONGODB_AUTH_URI"""'], {}), "('MONGODB_AUTH_URI')\n", (164, 184), False, 'import os\n'), ((202, 227), 'pymongo.MongoClient', 'MongoClient', (['mongo_s...
giserh/book-python
control-flow/solution/file_hosts.py
ebd4e70cea1dd56986aa8efbae3629ba3f1ba087
FILE = r'../src/etc-hosts.txt' hostnames = [] try: with open(FILE, encoding='utf-8') as file: content = file.readlines() except FileNotFoundError: print('File does not exist') except PermissionError: print('Permission denied') for line in content: if line.startswith('#'): continue ...
[]
eaedk/testing-zindi-package
zindi/docs/utils/n_subimissions_per_day.py
5aef7375a629b328fa8ecf9c4559e2897611a1e9
def n_subimissions_per_day( url, headers ): """Get the number of submissions we can make per day for the selected challenge. Parameters ---------- url : {'prize', 'points', 'knowledge' , 'all'}, default='all' The reward of the challenges for top challengers. headers : dictionary , T...
[]
ssavinash1/Algorithm_stanford
algo/test/test_maximum_cut.py
f2588b6bcac2b0858e78b819e6e8402109e80ee2
# -*- coding: utf-8 -*- import unittest from src.graph import Graph from src.maximum_cut import maximum_cut, maximum_cut_for_bipartite_graph class MaximumCut(unittest.TestCase): def test_maximum_cut_for_bipartite_graphs(self): """ Given the following bipartite graph. (a)-----(b) ...
[((480, 579), 'src.graph.Graph.build', 'Graph.build', ([], {'edges': "[('a', 'b'), ('a', 'c'), ('d', 'e'), ('f', 'e'), ('f', 'g')]", 'directed': '(False)'}), "(edges=[('a', 'b'), ('a', 'c'), ('d', 'e'), ('f', 'e'), ('f',\n 'g')], directed=False)\n", (491, 579), False, 'from src.graph import Graph\n'), ((655, 689), '...
kemonats/avs_commons
gdb/print-avs-rbtree.py
ecce4edf5376d132e3686af227c9adf22ce1090e
# -*- coding: utf-8 -*- # # Copyright 2021 AVSystem <avsystem@avsystem.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-2.0 # # Unless requi...
[((852, 889), 'gdb.lookup_type', 'gdb.lookup_type', (['"""unsigned long long"""'], {}), "('unsigned long long')\n", (867, 889), False, 'import gdb\n'), ((914, 936), 'gdb.lookup_type', 'gdb.lookup_type', (['"""int"""'], {}), "('int')\n", (929, 936), False, 'import gdb\n'), ((2583, 2611), 'gdb.string_to_argv', 'gdb.strin...
sampx/mongodb-practice
hour17/PythonGroup.py
0698b21b7da57693ba4146384c8ad65530b0066b
from pymongo import MongoClient def displayGroup(results): for result in results: print (result) def firstIsALastIsVowel(collection): key = {'first' : True, "last" : True} cond = {'first' : 'a', 'last' : {'$in' : ["a","e","i","o","u"]}} initial = {'count' : 0} red...
[((1199, 1240), 'pymongo.MongoClient', 'MongoClient', (['"""mongodb://localhost:27017/"""'], {}), "('mongodb://localhost:27017/')\n", (1210, 1240), False, 'from pymongo import MongoClient\n')]
pection/packnet-sfm
packnet_sfm/models/model_utils.py
d5673567b649e6bfda292c894cacdeb06aa80913
# Copyright 2020 Toyota Research Institute. All rights reserved. from packnet_sfm.utils.image import flip_lr, interpolate_scales from packnet_sfm.utils.misc import filter_dict from packnet_sfm.utils.types import is_tensor, is_list, is_numpy def flip(tensor, flip_fn): """ Flip tensors or list of tensors base...
[((3118, 3203), 'packnet_sfm.utils.misc.filter_dict', 'filter_dict', (['batch', "['rgb', 'rgb_context', 'input_depth', 'input_depth_context']"], {}), "(batch, ['rgb', 'rgb_context', 'input_depth', 'input_depth_context']\n )\n", (3129, 3203), False, 'from packnet_sfm.utils.misc import filter_dict\n'), ((3307, 3341), ...
dgerod/more-dmps
utils/stg/min_jerk_traj.py
4dc886a138f289532b2672537f91ff857448ad27
''' Created on 25.07.2012 @author: karl ''' def trajectory(start, goal, duration, delta_t): traj = [] # inital values t, td, tdd = start, 0, 0 for i in range(int(2 * duration / delta_t)): try: t, td, tdd = _min_jerk_step(t, td, tdd, goal, duration - i * delta_t, delta_t) except: break ...
[]
karanrampal/triplet-loss
tests/__init__.py
b62008dedbf8640ccf0dc359b5aadd5e8b0ab134
# To make directory as a python package
[]
jessicalettes/orthoexon
orthoexon/tests/test_util.py
463ad1908364c602cf75dbddb0b16a42f4100a36
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_orthoexon ---------------------------------- Tests for `orthoexon` module. """ import os import pytest @pytest.fixture def exon_id_with_quotes(): return "'ENSE00001229068.1'" @pytest.fixture def exon_id(): return "ENSE00001229068.1" def test_separate_...
[((406, 435), 'orthoexon.util.separate', 'separate', (['exon_id_with_quotes'], {}), '(exon_id_with_quotes)\n', (414, 435), False, 'from orthoexon.util import separate\n'), ((573, 590), 'orthoexon.util.separate', 'separate', (['exon_id'], {}), '(exon_id)\n', (581, 590), False, 'from orthoexon.util import separate\n'), (...
yeyupiaoling/Kersa-Speaker-Recognition
predict_recognition.py
7ccf42c006f42ff6074ad3937e44a0dfa68c6d33
import argparse import os import shutil import time import numpy as np from utils import model, utils from utils.record import RecordAudio parser = argparse.ArgumentParser() parser.add_argument('--audio_db', default='audio_db/', type=str, help='音频库的路径') parser.add_argument('--threshold', default=...
[((151, 176), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (174, 176), False, 'import argparse\n'), ((564, 631), 'utils.model.vggvox_resnet2d_icassp', 'model.vggvox_resnet2d_icassp', ([], {'input_dim': '(257, None, 1)', 'mode': '"""eval"""'}), "(input_dim=(257, None, 1), mode='eval')\n", (592...
vconrado/datacube-explorer
cubedash/_product.py
ccb9a9a42e5dd16e2b0325a1f881b080bb2806e6
import logging from datetime import timedelta from flask import Blueprint, Response, abort, redirect, url_for from cubedash import _model, _utils, _utils as utils _LOG = logging.getLogger(__name__) bp = Blueprint("product", __name__) @bp.route("/about.csv") def legacy_about_csv(): return redirect(".storage_csv...
[((173, 200), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (190, 200), False, 'import logging\n'), ((206, 236), 'flask.Blueprint', 'Blueprint', (['"""product"""', '__name__'], {}), "('product', __name__)\n", (215, 236), False, 'from flask import Blueprint, Response, abort, redirect, url...
ozbenh/litex-boards
litex_boards/platforms/sipeed_tang_nano.py
f18b10d1edb4e162a77972e2e9c5bad54ca00788
# # This file is part of LiteX-Boards. # # Copyright (c) 2021 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause # Board diagram/pinout: # https://user-images.githubusercontent.com/1450143/133655492-532d5e9a-0635-4889-85c9-68683d06cae0.png # http://dl.sipeed.com/TANG/Nano/HDK/Tang-NAN...
[((1509, 1620), 'litex.build.gowin.platform.GowinPlatform.__init__', 'GowinPlatform.__init__', (['self', '"""GW1N-LV1QN48C6/I5"""', '_io', '_connectors'], {'toolchain': '"""gowin"""', 'devicename': '"""GW1N-1"""'}), "(self, 'GW1N-LV1QN48C6/I5', _io, _connectors,\n toolchain='gowin', devicename='GW1N-1')\n", (1531, 1...
anon-6994/nm-metarl
nm_cavia/rl/metalearner.py
45c8798c2139d8c200cc7a398331c1b98a0dccec
import torch from torch.distributions.kl import kl_divergence from torch.nn.utils.convert_parameters import (vector_to_parameters, parameters_to_vector) from rl_utils.optimization import conjugate_gradient from rl_utils.torch_utils import (weighted_mean, detach_distributi...
[((2079, 2132), 'rl_utils.torch_utils.weighted_normalize', 'weighted_normalize', (['advantages'], {'weights': 'episodes.mask'}), '(advantages, weights=episodes.mask)\n', (2097, 2132), False, 'from rl_utils.torch_utils import weighted_mean, detach_distribution, weighted_normalize\n'), ((9105, 9132), 'torch.nn.utils.conv...
hramezani/django-request
request/management/commands/purgerequests.py
4b9c7b22f26338d2c93110477aa44041b1c5ddb4
from datetime import timedelta from dateutil.relativedelta import relativedelta from django.core.management.base import BaseCommand, CommandError from django.utils import timezone from ...models import Request DURATION_OPTIONS = { 'hours': lambda amount: timezone.now() - timedelta(hours=amount), 'days': lamb...
[((262, 276), 'django.utils.timezone.now', 'timezone.now', ([], {}), '()\n', (274, 276), False, 'from django.utils import timezone\n'), ((279, 302), 'datetime.timedelta', 'timedelta', ([], {'hours': 'amount'}), '(hours=amount)\n', (288, 302), False, 'from datetime import timedelta\n'), ((331, 345), 'django.utils.timezo...
kimtaehong/PythonForWindows
tests/test_crypto.py
d04eed1754e2e23474213b89580d68e1b73c3fe4
import pytest import windows.crypto import windows.generated_def as gdef import windows.crypto.generation from .pfwtest import * pytestmark = pytest.mark.usefixtures('check_for_gc_garbage') TEST_CERT = b""" MIIBwTCCASqgAwIBAgIQG46Uyws+67ZBOfPJCbFrRjANBgkqhkiG9w0BAQsFADAfMR0wGwYDVQQD ExRQeXRob25Gb3JXaW5kb3dzVGVzdDAe...
[((145, 192), 'pytest.mark.usefixtures', 'pytest.mark.usefixtures', (['"""check_for_gc_garbage"""'], {}), "('check_for_gc_garbage')\n", (168, 192), False, 'import pytest\n'), ((3143, 3159), 'pytest.fixture', 'pytest.fixture', ([], {}), '()\n', (3157, 3159), False, 'import pytest\n'), ((3210, 3226), 'pytest.fixture', 'p...
andreatramacere/cdci_data_analysis
cdci_data_analysis/analysis/plot_tools.py
8ae34a7252d6baf011a3b99fbe4f6e624b63d7df
from __future__ import absolute_import, division, print_function from builtins import (bytes, str, open, super, range, zip, round, input, int, pow, object, map, zip) __author__ = "Andrea Tramacere" import numpy as np from astropy import wcs from bokeh.layouts import row, widgetbox,gridplot ...
[((1406, 1557), 'bokeh.plotting.figure', 'figure', ([], {'plot_width': 'w', 'plot_height': 'h', 'x_range': '(0, c * 0.5)', 'y_range': '(0, r * 0.5)', 'tools': "['pan,box_zoom,box_select,wheel_zoom,reset,save,crosshair']"}), "(plot_width=w, plot_height=h, x_range=(0, c * 0.5), y_range=(0, r * \n 0.5), tools=['pan,box...
RebelCodeBase/testaid
test/unit/test_testaid_unit_pathlist.py
998c827b826fe4374ecf0a234fef61a975e2fcd7
from pathlib import Path from testaid.pathlist import PathList def test_testaid_unit_pathlist_roles_blacklist(testvars_roles_blacklist): assert testvars_roles_blacklist is not None def test_testaid_unit_pathlist_roles_whitelist(testvars_roles_whitelist): assert testvars_roles_whitelist is not None def tes...
[((774, 802), 'testaid.pathlist.PathList', 'PathList', (['my_pathstring', 'msd'], {}), '(my_pathstring, msd)\n', (782, 802), False, 'from testaid.pathlist import PathList\n'), ((675, 686), 'pathlib.Path', 'Path', (['file3'], {}), '(file3)\n', (679, 686), False, 'from pathlib import Path\n'), ((688, 699), 'pathlib.Path'...
vkpro-forks/python-zhmcclient
tests/unit/zhmcclient/test_hba.py
eab2dca37cb417d03411450dabf72805214b5ca0
# Copyright 2016-2017 IBM Corp. 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...
[((6104, 7390), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""filter_args, exp_oids"""', "[({'element-id': HBA1_OID}, [HBA1_OID]), ({'element-id': HBA2_OID}, [\n HBA2_OID]), ({'element-id': [HBA1_OID, HBA2_OID]}, [HBA1_OID, HBA2_OID]\n ), ({'element-id': [HBA1_OID, HBA1_OID]}, [HBA1_OID]), ({'elemen...
medismailben/llvm-project
compiler-rt/test/asan/TestCases/Windows/lit.local.cfg.py
e334a839032fe500c3bba22bf976ab7af13ce1c1
def getRoot(config): if not config.parent: return config return getRoot(config.parent) root = getRoot(config) # We only run a small set of tests on Windows for now. # Override the parent directory's "unsupported" decision until we can handle # all of its tests. if root.host_os in ['Windows']: config.unsuppo...
[]
oskomorokhov/cpython
Lib/test/libregrtest/utils.py
c0e11a3ceb9427e09db4224f394c7789bf6deec5
import math import os.path import sys import textwrap from test import support def format_duration(seconds): ms = math.ceil(seconds * 1e3) seconds, ms = divmod(ms, 1000) minutes, seconds = divmod(seconds, 60) hours, minutes = divmod(minutes, 60) parts = [] if hours: parts.append('%s h...
[((120, 147), 'math.ceil', 'math.ceil', (['(seconds * 1000.0)'], {}), '(seconds * 1000.0)\n', (129, 147), False, 'import math\n'), ((1571, 1597), 'test.support.print_warning', 'support.print_warning', (['msg'], {}), '(msg)\n', (1592, 1597), False, 'from test import support\n'), ((2201, 2221), 'sys.modules.values', 'sys...
Syrkadian/efetch
efetch_server/plugins/fa_sqlite/fa_sqlite_ajax.py
120ac963507d54998beecfd8b8cd85ad123e6e54
""" AJAX for SQLite Viewer plugin """ from yapsy.IPlugin import IPlugin from flask import Response, jsonify import json import logging import sqlite3 class FaSqliteAjax(IPlugin): def __init__(self): self.display_name = 'SQLite Ajax' self.popularity = 0 self.cache = True self.fast ...
[((364, 386), 'yapsy.IPlugin.IPlugin.__init__', 'IPlugin.__init__', (['self'], {}), '(self)\n', (380, 386), False, 'from yapsy.IPlugin import IPlugin\n'), ((420, 442), 'yapsy.IPlugin.IPlugin.activate', 'IPlugin.activate', (['self'], {}), '(self)\n', (436, 442), False, 'from yapsy.IPlugin import IPlugin\n'), ((493, 517)...
sslppractice/propython
raspagem/random/lista_cidades.py
fa470c3bf0dcfbb26037146d77c7491596cabb26
import requests, json url = 'http://educacao.dadosabertosbr.com/api/cidades/ce' cidades = requests.get(url).content cidades = cidades.decode('utf-8') cidades = json.loads(cidades) for cidade in cidades: codigo, nome = cidade.split(':') print(nome)
[((161, 180), 'json.loads', 'json.loads', (['cidades'], {}), '(cidades)\n', (171, 180), False, 'import requests, json\n'), ((91, 108), 'requests.get', 'requests.get', (['url'], {}), '(url)\n', (103, 108), False, 'import requests, json\n')]
startupgrind/mezzanine
mezzanine/__init__.py
23d24a07c69bf8f02d60148b0b8da6c76bc5061e
__version__ = "4.3.1.post1"
[]