repo_name
stringlengths
7
94
repo_path
stringlengths
4
237
repo_head_hexsha
stringlengths
40
40
content
stringlengths
10
680k
apis
stringlengths
2
680k
by-liu/SegLossBia
tools/test_net.py
9cc639c04084cda9d5fb20ea34699db7e0beaf5c
import sys import logging from seglossbias.utils import mkdir, setup_logging from seglossbias.engine import default_argument_parser, load_config, DefaultTester logger = logging.getLogger(__name__) def setup(args): cfg = load_config(args) mkdir(cfg.OUTPUT_DIR) setup_logging(output_dir=cfg.OUTPUT_DIR) ...
[((171, 198), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (188, 198), False, 'import logging\n'), ((228, 245), 'seglossbias.engine.load_config', 'load_config', (['args'], {}), '(args)\n', (239, 245), False, 'from seglossbias.engine import default_argument_parser, load_config, DefaultTe...
anielsen001/sarpy
sarpy/io/nitf/tres/unclass/ENGRDA.py
07bf157f54a5304185fc0e1c34010053fd6ae9d9
# -*- coding: utf-8 -*- from ..tre_elements import TREExtension, TREElement __classification__ = "UNCLASSIFIED" __author__ = "Thomas McCullough" class RECORD(TREElement): def __init__(self, value): super(RECORD, self).__init__() self.add_field('ENGLN', 'd', 2, value) self.add_field('ENG...
[]
lingruiluo/jp_doodle
jp_doodle/quantity_forest.py
b3935208821898f22ab504c2b26dd4d37f08f0e4
from jp_doodle import doodle_files qf_js = doodle_files.vendor_path("js/quantity_forest.js") from jp_doodle import dual_canvas import jp_proxy_widget import os from subprocess import check_output import pprint if bytes != str: unicode = str def directory_usage(directory, epsilon=0.02): if not os.path.isdir(di...
[((43, 92), 'jp_doodle.doodle_files.vendor_path', 'doodle_files.vendor_path', (['"""js/quantity_forest.js"""'], {}), "('js/quantity_forest.js')\n", (67, 92), False, 'from jp_doodle import doodle_files\n'), ((359, 380), 'os.listdir', 'os.listdir', (['directory'], {}), '(directory)\n', (369, 380), False, 'import os\n'), ...
YuweiYin/Algorithm_YuweiYin
LeetCode-All-Solution/Python3/LC-0035-Search-Insert-Position.py
28648fac59c5a4e3c907978cbd1b3e662ba18fd5
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0035-Search-Insert-Position.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-01-01 ============================...
[((2847, 2866), 'time.process_time', 'time.process_time', ([], {}), '()\n', (2864, 2866), False, 'import time\n'), ((2923, 2942), 'time.process_time', 'time.process_time', ([], {}), '()\n', (2940, 2942), False, 'import time\n')]
firodj/ciscodevnet-coding-skills-sample-code
coding202-parsing-json/get-ap-json-1.py
4fca975e450cf0c913001fe1b36582f7a094b1e7
import requests url = 'https://64.103.26.61/api/contextaware/v1/maps/info/DevNetCampus/DevNetBuilding/DevNetZone' headers = {'Authorization': 'Basic bGVhcm5pbmc6bGVhcm5pbmc=='} response = requests.get(url, headers=headers, verify=False) responseString = response.text print(responseString)
[((188, 236), 'requests.get', 'requests.get', (['url'], {'headers': 'headers', 'verify': '(False)'}), '(url, headers=headers, verify=False)\n', (200, 236), False, 'import requests\n')]
LaudateCorpus1/llvm-project
lldb/test/API/lang/swift/optimized_code/bound_generic_enum/TestSwiftOptimizedBoundGenericEnum.py
ff2e0f0c1112558b3f30d8afec7c9882c33c79e3
import lldb from lldbsuite.test.decorators import * import lldbsuite.test.lldbtest as lldbtest import lldbsuite.test.lldbutil as lldbutil import os import unittest2 class TestSwiftOptimizedBoundGenericEnum(lldbtest.TestBase): mydir = lldbtest.TestBase.compute_mydir(__file__) @swiftTest def test(self): ...
[((241, 282), 'lldbsuite.test.lldbtest.TestBase.compute_mydir', 'lldbtest.TestBase.compute_mydir', (['__file__'], {}), '(__file__)\n', (272, 282), True, 'import lldbsuite.test.lldbtest as lldbtest\n'), ((836, 894), 'lldbsuite.test.lldbutil.check_variable', 'lldbutil.check_variable', (['self', 'var_self', '(False)'], {'...
wentzlau/kervi
kervi/kervi/plugin/routing/kervi_io/__init__.py
d35a422a6bca6b0ef50a4f9e5c382dece855abdc
#Copyright 2017 Tim Wentlau. #Distributed under the MIT License. See LICENSE in root of project. def init_plugin(config, manager): from kervi.plugin.routing.kervi_io.mq_router import KerviIORouterPlugin return KerviIORouterPlugin(config, manager) def plugin_type(): return "routing"
[((219, 255), 'kervi.plugin.routing.kervi_io.mq_router.KerviIORouterPlugin', 'KerviIORouterPlugin', (['config', 'manager'], {}), '(config, manager)\n', (238, 255), False, 'from kervi.plugin.routing.kervi_io.mq_router import KerviIORouterPlugin\n')]
ghostFaceKillah/bc-gym-planning-env
bc_gym_planning_env/envs/base/action.py
3cc0eb03adb752d304c3f007675cfff86691d007
""" Code for wrapping the motion primitive action in an object. """ from __future__ import division from __future__ import absolute_import import attr import numpy as np from bc_gym_planning_env.utilities.serialize import Serializable @attr.s(cmp=False) class Action(Serializable): """ Object representing an 'ac...
[((240, 257), 'attr.s', 'attr.s', ([], {'cmp': '(False)'}), '(cmp=False)\n', (246, 257), False, 'import attr\n'), ((411, 435), 'attr.ib', 'attr.ib', ([], {'type': 'np.ndarray'}), '(type=np.ndarray)\n', (418, 435), False, 'import attr\n'), ((567, 639), 'numpy.array', 'np.array', (['[wanted_linear_velocity_of_baselink, w...
ccfelius/queueing
histogram.py
c38bd2fe230e52d6166a94449cec28f82e245ec2
import matplotlib.pyplot as plt import pandas as pd import math import numpy as np from scipy import stats import seaborn as sns data = pd.read_csv("data/500-4.txt", sep="\t") # example1 = data[data["SIM_TIME"] == 500] simulations = 500 simtimes = [5, 50, 150, 500, 1000] # for i in [1, 2, 4]: # data = pd.read_c...
[((137, 176), 'pandas.read_csv', 'pd.read_csv', (['"""data/500-4.txt"""'], {'sep': '"""\t"""'}), "('data/500-4.txt', sep='\\t')\n", (148, 176), True, 'import pandas as pd\n'), ((531, 571), 'pandas.read_csv', 'pd.read_csv', (['f"""data/500-2.txt"""'], {'sep': '"""\t"""'}), "(f'data/500-2.txt', sep='\\t')\n", (542, 571),...
zheedong/BaekJoon
python/1931.py
7f9e00085276a337d18ee3bb90c98126f7af4d3a
n = int(input()) conf_set = [] for _ in range(n): conf_set.append(tuple(map(int, input().split()))) conf_set.sort(key=lambda x : (x[1], x[0])) # ๋๋‚˜๋Š” ์‹œ๊ฐ„์„ ๊ธฐ์ค€์œผ๋กœ ์ •๋ ฌ # ์‹œ์ž‘๊ณผ ์ข…๋ฃŒ๊ฐ€ ๊ฐ™์€ ๊ฒฝ์šฐ๋ฅผ ํฌํ•จํ•˜๊ธฐ ์œ„ํ•ด์„ , ์‹œ์ž‘ ์‹œ๊ฐ„๋„ ์˜ค๋ฆ„์ฐจ์ˆœ์œผ๋กœ ์ •๋ ฌํ•ด ์ค˜์•ผ ํ•œ๋‹ค solution_list = [conf_set[0]] # Greedy Algorithm for conf in conf_set[1:]: last_conf = solution...
[]
python-social-auth/social-app-webpy
social_webpy/app.py
edcfd8dd95c66a3524961e5212e13c9c2e8515a3
import web from social_core.actions import do_auth, do_complete, do_disconnect from .utils import psa, load_strategy, load_strategy urls = ( r'/login/(?P<backend>[^/]+)/?', 'auth', r'/complete/(?P<backend>[^/]+)/?', 'complete', r'/disconnect/(?P<backend>[^/]+)/?', 'disconnect', r'/disconnect/(?P<bac...
[((609, 634), 'web.input', 'web.input', ([], {'_method': 'method'}), '(_method=method)\n', (618, 634), False, 'import web\n'), ((1419, 1440), 'social_core.actions.do_auth', 'do_auth', (['self.backend'], {}), '(self.backend)\n', (1426, 1440), False, 'from social_core.actions import do_auth, do_complete, do_disconnect\n'...
gomyar/stellar
stellar/config.py
b2dfbe136f1540f0ca6ac5779ebaeae996a3b747
import os import logging import yaml from schema import Use, Schema, SchemaError, Optional class InvalidConfig(Exception): pass class MissingConfig(Exception): pass default_config = { 'logging': 30, 'migrate_from_0_3_2': True } schema = Schema({ 'stellar_url': Use(str), 'url': Use(str), ...
[((508, 519), 'os.getcwd', 'os.getcwd', ([], {}), '()\n', (517, 519), False, 'import os\n'), ((1020, 1047), 'os.getenv', 'os.getenv', (['"""STELLAR_CONFIG"""'], {}), "('STELLAR_CONFIG')\n", (1029, 1047), False, 'import os\n'), ((389, 408), 'schema.Optional', 'Optional', (['"""logging"""'], {}), "('logging')\n", (397, 4...
texpomru13/espnet
egs2/mr_openslr64/asr1/local/data_prep.py
7ef005e832e2fb033f356c16f54e0f08762fb4b0
#!/usr/bin/env python3 # Copyright 2021 Carnegie Mellon University (Peter Wu) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import os import random if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-d", help="downloads directory", type=str, def...
[((223, 248), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (246, 248), False, 'import argparse\n'), ((779, 799), 'os.path.exists', 'os.path.exists', (['path'], {}), '(path)\n', (793, 799), False, 'import os\n'), ((1319, 1335), 'random.Random', 'random.Random', (['(0)'], {}), '(0)\n', (1332, 1...
eulerkaku/movement_validation
movement_validation/features/feature_processing_options.py
af939a42a97c1de889cf13bad0c22a2824d60947
# -*- coding: utf-8 -*- """ This module will hold a class that will be referenced when processing features. I'd like to move things from "config" into here ... - @JimHokanson """ from __future__ import division from .. import utils #Can't do this, would be circular #from .worm_features import WormFeatures class...
[]
wathsalav/xos
xos/ec2_observer/steps/__init__.py
f6bcaa37a948ee41729236afe7fce0802e002404
#from .sync_external_routes import SyncExternalRoutes #from .sync_network_slivers import SyncNetworkSlivers #from .sync_networks import SyncNetworks #from .sync_network_deployments import SyncNetworkDeployments #from .sync_site_privileges import SyncSitePrivilege #from .sync_slice_memberships import SyncSliceMembership...
[]
NHPatterson/napari-geojson
src/napari_geojson/_tests/test_writer.py
8e7925dc7600608673d489e24e8760c4669eaa0b
import geojson import pytest from napari_geojson import write_shapes ellipse = [[[0, 0], [0, 5], [5, 5], [5, 0]], "ellipse", "Polygon"] line = [[[0, 0], [5, 5]], "line", "LineString"] polygon = [[[0, 0], [5, 5], [0, 10]], "polygon", "Polygon"] polyline = [[[0, 0], [5, 5], [0, 10]], "path", "LineString"] rectangle = [...
[((520, 616), 'pytest.mark.parametrize', 'pytest.mark.parametrize', (['"""coords,shape_type,expected"""', 'sample_shapes'], {'ids': 'sample_shapes_ids'}), "('coords,shape_type,expected', sample_shapes, ids=\n sample_shapes_ids)\n", (543, 616), False, 'import pytest\n'), ((1045, 1076), 'napari_geojson.write_shapes', ...
woozway/py3-leetcode
algorithms/521. Longest Uncommon Subsequence I.py
e51a9ce7a6bb3e35c0fcb8c8f4f6cd5763708dbf
class Solution: def findLUSlength(self, a: str, b: str) -> int: return -1 if a == b else max(len(a), len(b))
[]
echoyi/pgmpy
pgmpy/models/ClusterGraph.py
c37dda4401f23ec73fc5d17d957867cd62e588d3
#!/usr/bin/env python3 from collections import defaultdict import numpy as np from pgmpy.base import UndirectedGraph from pgmpy.factors import factor_product class ClusterGraph(UndirectedGraph): r""" Base class for representing Cluster Graph. Cluster graph is an undirected graph which is associated wi...
[((8516, 8532), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (8527, 8532), False, 'from collections import defaultdict\n'), ((9995, 10016), 'numpy.sum', 'np.sum', (['factor.values'], {}), '(factor.values)\n', (10001, 10016), True, 'import numpy as np\n')]
stonewell/eim
plugins/commands_window/plugin.py
50fc4bb6e265ed8a5eb84577fd203e83934d55a7
from PySide6.QtWidgets import QListWidgetItem from yapsy.IPlugin import IPlugin class Plugin(IPlugin): def __init__(self): IPlugin.__init__(self) def activate(self): IPlugin.activate(self) return def deactivate(self): IPlugin.deactivate(self) def set_current_window(self, ...
[((141, 163), 'yapsy.IPlugin.IPlugin.__init__', 'IPlugin.__init__', (['self'], {}), '(self)\n', (157, 163), False, 'from yapsy.IPlugin import IPlugin\n'), ((194, 216), 'yapsy.IPlugin.IPlugin.activate', 'IPlugin.activate', (['self'], {}), '(self)\n', (210, 216), False, 'from yapsy.IPlugin import IPlugin\n'), ((261, 285)...
zroger49/broadlink_custom_component
custom_components/helpers.py
c7b0f9648f1dbaad64e573561e852b689be5a755
"""Helpers for the Broadlink remote.""" from base64 import b64decode from homeassistant.helpers import config_validation as cv def decode_packet(value): """Decode a data packet given for a Broadlink remote.""" value = cv.string(value) extra = len(value) % 4 if extra > 0: value = value + ("=" ...
[((229, 245), 'homeassistant.helpers.config_validation.string', 'cv.string', (['value'], {}), '(value)\n', (238, 245), True, 'from homeassistant.helpers import config_validation as cv\n'), ((346, 362), 'base64.b64decode', 'b64decode', (['value'], {}), '(value)\n', (355, 362), False, 'from base64 import b64decode\n')]
subramp-prep/leetcode
problems/139.Word_Break/AC_dp_n2.py
d125201d9021ab9b1eea5e5393c2db4edd84e740
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: illuz <iilluzen[at]gmail.com> # File: AC_dp_n2.py # Create Date: 2015-04-21 10:21:18 # Usage: AC_dp_n2.py # Descripton: class Solution: # @param s, a string # @param dict, a set of string # @return a boolean def wordBreak(self, s...
[]
motionfigures/bullet3
examples/pybullet/gym/pybullet_envs/bullet/kukaCamGymEnv.py
4a66d6c80b38a87ecbdf2fd5c4d281f0b5913d22
import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0,parentdir) import math import gym from gym import spaces from gym.utils import seeding import numpy as np import time import pybullet...
[((164, 196), 'os.sys.path.insert', 'os.sys.path.insert', (['(0)', 'parentdir'], {}), '(0, parentdir)\n', (182, 196), False, 'import os, inspect\n'), ((135, 162), 'os.path.dirname', 'os.path.dirname', (['currentdir'], {}), '(currentdir)\n', (150, 162), False, 'import os, inspect\n'), ((656, 683), 'pybullet_data.getData...
kumar-pratik/hi-ml
hi-ml-histopathology/src/histopathology/preprocessing/tiling.py
a108cf4ea244a76127adedc0ca60f0a5afdfb3e8
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
[((2038, 2074), 'numpy.pad', 'np.pad', (['array', 'padding'], {}), '(array, padding, **pad_kwargs)\n', (2044, 2074), True, 'import numpy as np\n'), ((5985, 6018), 'numpy.full', 'np.full', (['output_shape', 'fill_value'], {}), '(output_shape, fill_value)\n', (5992, 6018), True, 'import numpy as np\n'), ((6033, 6059), 'n...
savcardamone/tyche-
miniapp/miniapp/hartreefock/hf.py
ea89edea89a607291e4fe0ba738d75522f54dc1a
from math import pi from numpy import array, ndarray, divide, sqrt, argsort, sort, diag, trace from numpy.linalg import eig, norm class HartreeFock(): zeta = array([38.474970, 5.782948, 1.242567, 0.298073]) num_aos = len(zeta) num_mos = 0 energy_tolerance = 0.0001; density_tolerance = 0.001 ...
[((170, 217), 'numpy.array', 'array', (['[38.47497, 5.782948, 1.242567, 0.298073]'], {}), '([38.47497, 5.782948, 1.242567, 0.298073])\n', (175, 217), False, 'from numpy import array, ndarray, divide, sqrt, argsort, sort, diag, trace\n'), ((1103, 1170), 'numpy.ndarray', 'ndarray', ([], {'shape': '(self.num_aos, self.num...
shengqiangzhang/examples-of-web-crawlers
6.็ˆฌๅ–่ฑ†็“ฃๆŽ’่กŒๆฆœ็”ตๅฝฑๆ•ฐๆฎ(ๅซGUI็•Œ้ข็‰ˆ)/main.py
89eb6c169b8824a6a9bc78e7a32e064d33560aa7
# -*- coding:utf-8 -*- from uiObject import uiObject # mainๅ…ฅๅฃ if __name__ == '__main__': ui = uiObject() ui.ui_process()
[((102, 112), 'uiObject.uiObject', 'uiObject', ([], {}), '()\n', (110, 112), False, 'from uiObject import uiObject\n')]
eude313/vault
photos/models.py
d3e24cf01d15de94244b7d2e80316355a0827f74
from django.db import models from cloudinary.models import CloudinaryField # Create your models here. class Category(models.Model): name = models.CharField( max_length=200, null=False, blank=False ) def __str__(self): return self.name class Photo(models.Model): category = models.ForeignKey(...
[((145, 202), 'django.db.models.CharField', 'models.CharField', ([], {'max_length': '(200)', 'null': '(False)', 'blank': '(False)'}), '(max_length=200, null=False, blank=False)\n', (161, 202), False, 'from django.db import models\n'), ((302, 379), 'django.db.models.ForeignKey', 'models.ForeignKey', (['Category'], {'on_...
christiansencq/ibm_capstone
server/djangoapp/restapis.py
d445fd40c0267be0948a5d85e9d43828b908641c
import requests import json # import related models here from .models import CarDealer, DealerReview from requests.auth import HTTPBasicAuth import logging logger = logging.getLogger(__name__) # Create a `get_request` to make HTTP GET requests # e.g., response = requests.get(url, params=params, headers={'Content-Type...
[((166, 193), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (183, 193), False, 'import logging\n'), ((966, 991), 'json.loads', 'json.loads', (['response.text'], {}), '(response.text)\n', (976, 991), False, 'import json\n'), ((1293, 1396), 'requests.post', 'requests.post', (['url'], {'hea...
oslokommune/okdata-data-uploader
examples/python/upload.py
fc006ae90440b267613260bba90235799bf0cf6e
import logging from configparser import ConfigParser from sdk.data_uploader import DataUploader logging.basicConfig(level=logging.INFO) log = logging.getLogger() config = ConfigParser() config.read("config.ini") ##### # Datasets to be added to metadata API datasetData = { "title": "Test", "description": "Tes...
[((97, 136), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.INFO'}), '(level=logging.INFO)\n', (116, 136), False, 'import logging\n'), ((143, 162), 'logging.getLogger', 'logging.getLogger', ([], {}), '()\n', (160, 162), False, 'import logging\n'), ((173, 187), 'configparser.ConfigParser', 'Config...
Enerccio/mahjong
doc/examples.py
903505a7886c31845dfa6b3f54c936a4feb29e6e
from mahjong.hand_calculating.hand import HandCalculator from mahjong.meld import Meld from mahjong.hand_calculating.hand_config import HandConfig, OptionalRules from mahjong.shanten import Shanten from mahjong.tile import TilesConverter calculator = HandCalculator() # useful helper def print_hand_result(hand_result...
[((252, 268), 'mahjong.hand_calculating.hand.HandCalculator', 'HandCalculator', ([], {}), '()\n', (266, 268), False, 'from mahjong.hand_calculating.hand import HandCalculator\n'), ((772, 844), 'mahjong.tile.TilesConverter.string_to_136_array', 'TilesConverter.string_to_136_array', ([], {'man': '"""22444"""', 'pin': '""...
Infinidat/mount-utils
src/infi/mount_utils/solaris/mounter.py
e4e08e21c278a2391494a7b9d9d7efdaeb393a9c
from ..base.mounter import MounterMixin, execute_mount class SolarisMounterMixin(MounterMixin): def _get_fstab_path(self): return "/etc/fstab" def _get_entry_format(self, entry): return entry.get_format_solaris() def mount_entry(self, entry): args = ["-F", entry.get_typename(), en...
[]
EladGabay/pulumi-oci
sdk/python/pulumi_oci/database/get_external_non_container_database.py
6841e27d4a1a7e15c672306b769912efbfd3ba99
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
[((5361, 5395), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""characterSet"""'}), "(name='characterSet')\n", (5374, 5395), False, 'import pulumi\n'), ((5577, 5612), 'pulumi.getter', 'pulumi.getter', ([], {'name': '"""compartmentId"""'}), "(name='compartmentId')\n", (5590, 5612), False, 'import pulumi\n'), ((5860,...
xmedius/xmedius-mailrelayserver
setup.py
44bb55c4b543e96bb23a45499d281c1bbab18abf
from setuptools import setup from setuptools.command.install import install class PostInstallCommand(install): user_options = install.user_options + [ ('noservice', None, None), ] def initialize_options(self): install.initialize_options(self) self.noservice = None def finalize...
[((578, 1309), 'setuptools.setup', 'setup', ([], {'name': '"""xmediusmailrelayserver"""', 'version': '"""1.0.0"""', 'description': '"""The Python module to be used to relay mail to different servers depending on patterns"""', 'long_description': '"""See https://github.com/xmedius/xmedius-mailrelayserver for more inform...
tsbxmw/leetcode
143.py
e751311b8b5f2769874351717a22c35c19b48a36
# 143. ้‡ๆŽ’้“พ่กจ # ็ป™ๅฎšไธ€ไธชๅ•้“พ่กจ L๏ผšL0โ†’L1โ†’โ€ฆโ†’Ln-1โ†’Ln ๏ผŒ # ๅฐ†ๅ…ถ้‡ๆ–ฐๆŽ’ๅˆ—ๅŽๅ˜ไธบ๏ผš L0โ†’Lnโ†’L1โ†’Ln-1โ†’L2โ†’Ln-2โ†’โ€ฆ # ไฝ ไธ่ƒฝๅชๆ˜ฏๅ•็บฏ็š„ๆ”นๅ˜่Š‚็‚นๅ†…้ƒจ็š„ๅ€ผ๏ผŒ่€Œๆ˜ฏ้œ€่ฆๅฎž้™…็š„่ฟ›่กŒ่Š‚็‚นไบคๆขใ€‚ # ็คบไพ‹ 1: # ็ป™ๅฎš้“พ่กจ 1->2->3->4, ้‡ๆ–ฐๆŽ’ๅˆ—ไธบ 1->4->2->3. # ็คบไพ‹ 2: # ็ป™ๅฎš้“พ่กจ 1->2->3->4->5, ้‡ๆ–ฐๆŽ’ๅˆ—ไธบ 1->5->2->4->3. # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # ...
[]
Toranktto/CraftProtocol
CraftProtocol/NBT/NBTTagList.py
a6f4a67756c3868820ab76df5e148d76b020d990
#!/usr/bin/env python from CraftProtocol.NBT.NBTBase import NBTBase from CraftProtocol.NBT.NBTProvider import NBTProvider from CraftProtocol.StreamIO import StreamIO class NBTTagList(NBTBase): TYPE_ID = 0x09 def __init__(self, tag_type, values=None): NBTBase.__init__(self) if values is None...
[((271, 293), 'CraftProtocol.NBT.NBTBase.NBTBase.__init__', 'NBTBase.__init__', (['self'], {}), '(self)\n', (287, 293), False, 'from CraftProtocol.NBT.NBTBase import NBTBase\n'), ((1611, 1638), 'CraftProtocol.StreamIO.StreamIO.read_ubyte', 'StreamIO.read_ubyte', (['stream'], {}), '(stream)\n', (1630, 1638), False, 'fro...
lapaniku/GAS
examples/0b02b172-ad67-449b-b4a2-ff645b28c508.py
e49ce302689af683da744cd172e0359c0ba0af86
# This program was generated by "Generative Art Synthesizer" # Generation date: 2021-11-28 09:21:40 UTC # GAS change date: 2021-11-28 09:20:21 UTC # GAS md5 hash: ad55481e87ca5a7e9a8e92cd336d1cad # Python version: 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)] # For more informat...
[((2606, 2643), 'numpy.zeros', 'np.zeros', (['(SIZE, SIZE, GRID_CHANNELS)'], {}), '((SIZE, SIZE, GRID_CHANNELS))\n', (2614, 2643), True, 'import numpy as np\n'), ((25379, 25404), 'numpy.zeros', 'np.zeros', (['(SIZE, SIZE, 3)'], {}), '((SIZE, SIZE, 3))\n', (25387, 25404), True, 'import numpy as np\n'), ((25692, 25722), ...
comydream/OpenNMT-py
onmt/bin/build_vocab.py
2f3c810069ca03b752d9886782648e576b39a06d
#!/usr/bin/env python """Get vocabulary coutings from transformed corpora samples.""" from onmt.utils.logging import init_logger from onmt.utils.misc import set_random_seed, check_path from onmt.utils.parse import ArgumentParser from onmt.opts import dynamic_prepare_opts from onmt.inputters.corpus import build_vocab fr...
[((752, 817), 'onmt.utils.parse.ArgumentParser.validate_prepare_opts', 'ArgumentParser.validate_prepare_opts', (['opts'], {'build_vocab_only': '(True)'}), '(opts, build_vocab_only=True)\n', (788, 817), False, 'from onmt.utils.parse import ArgumentParser\n'), ((941, 954), 'onmt.utils.logging.init_logger', 'init_logger',...
dssg/mlpolicylab_fall20_schools3_public
schools3/ml/experiments/feat_pruning_experiment.py
f8eff4c56e9bada1eb81ddaca03686d7ef53c2c4
import numpy as np import pandas as pd from schools3.ml.experiments.models_experiment import ModelsExperiment from schools3.data.base.cohort import Cohort from schools3.config import main_config from schools3.config import global_config from schools3.data.datasets.dataset import Dataset from schools3.ml.experiments.fea...
[((1561, 1587), 'schools3.data.base.cohort.Cohort', 'Cohort', (['grade', 'train_years'], {}), '(grade, train_years)\n', (1567, 1587), False, 'from schools3.data.base.cohort import Cohort\n'), ((1602, 1616), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (1614, 1616), True, 'import pandas as pd\n'), ((1938, 2037)...
imsb-uke/podometric_u_net
network/dataset/image_loading.py
a33afcc186d618889df73c7ab2941dfbb63574ac
import os import numpy as np from skimage.io import imread def get_file_count(paths, image_format='.tif'): total_count = 0 for path in paths: try: path_list = [_ for _ in os.listdir(path) if _.endswith(image_format)] total_count += len(path_list) except OSError: ...
[((491, 507), 'skimage.io.imread', 'imread', (['img_path'], {}), '(img_path)\n', (497, 507), False, 'from skimage.io import imread\n'), ((705, 722), 'skimage.io.imread', 'imread', (['mask_path'], {}), '(mask_path)\n', (711, 722), False, 'from skimage.io import imread\n'), ((820, 866), 'os.path.join', 'os.path.join', ([...
kefir/snakee
series/simple/numeric_series.py
a17734d4b2d7dfd3e6c7b195baa128fbc84d197b
from typing import Optional, Callable try: # Assume we're a sub-module in a package. from series import series_classes as sc from utils import numeric as nm except ImportError: # Apparently no higher-level package has been imported, fall back to a local import. from .. import series_classes as sc fro...
[((3727, 3793), 'utils.numeric.is_local_extremum', 'nm.is_local_extremum', (['*a'], {'local_min': 'local_min', 'local_max': 'local_max'}), '(*a, local_min=local_min, local_max=local_max)\n', (3747, 3793), True, 'from utils import numeric as nm\n')]
kuropengin/SHINtube-video-api
app/internal/module/video/database.py
8a4b068fb95a9a2736b3dba3782dbbbf73815290
import glob import pathlib from .filemanager import filemanager_class class database_class(filemanager_class): def __init__(self): filemanager_class.__init__(self) async def update_info(self, year, cid, vid, title, explanation): # ๆ—ขๅญ˜ใฎjsonใ‚’่ชญใฟ่พผใฟ json_file = "/".join([self.video_dir, str...
[((2763, 2792), 'glob.glob', 'glob.glob', (['f"""{directory}/1.*"""'], {}), "(f'{directory}/1.*')\n", (2772, 2792), False, 'import glob\n'), ((4384, 4413), 'glob.glob', 'glob.glob', (['f"""{directory}/1.*"""'], {}), "(f'{directory}/1.*')\n", (4393, 4413), False, 'import glob\n')]
scoofy/open-geotiling
python/OpenGeoTile.py
0b1305d4482d6df46104135662ffe4565f92f9f0
from openlocationcode import openlocationcode as olc from enum import Enum import math, re class TileSize(Enum): ''' An area of 20ยฐ x 20ยฐ. The side length of this tile varies with its location on the globe, but can be up to approximately 2200km. Tile addresses will be 2 characters long.''' GLOBAL = (2,...
[((12271, 12292), 'openlocationcode.openlocationcode.decode', 'olc.decode', (['self.code'], {}), '(self.code)\n', (12281, 12292), True, 'from openlocationcode import openlocationcode as olc\n'), ((19098, 19122), 'math.atan2', 'math.atan2', (['yDiff', 'xDiff'], {}), '(yDiff, xDiff)\n', (19108, 19122), False, 'import mat...
ShujaKhalid/deep-rl
deep-rl/lib/python2.7/site-packages/OpenGL/arrays/arraydatatype.py
99c6ba6c3095d1bfdab81bd01395ced96bddd611
"""Array data-type implementations (abstraction points for GL array types""" import ctypes import OpenGL from OpenGL.raw.GL import _types from OpenGL import plugins from OpenGL.arrays import formathandler, _arrayconstants as GL_1_1 from OpenGL import logs _log = logs.getLog( 'OpenGL.arrays.arraydatatype' ) from OpenG...
[((263, 305), 'OpenGL.logs.getLog', 'logs.getLog', (['"""OpenGL.arrays.arraydatatype"""'], {}), "('OpenGL.arrays.arraydatatype')\n", (274, 305), False, 'from OpenGL import logs\n'), ((8774, 8805), 'ctypes.POINTER', 'ctypes.POINTER', (['_types.GLclampd'], {}), '(_types.GLclampd)\n', (8788, 8805), False, 'import ctypes\n...
jbergmanster/probability
tensorflow_probability/python/build_defs.bzl
e15b307066e7485b8fe9faf3d289c739ab8d3806
# Copyright 2019 The TensorFlow Probability Authors. # # 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 o...
[]
lschmelzeisen/wikidata-history-analyzer
src/wikidated/wikidata/wikidata_dump.py
8673639b61839d2dca271fbbaf2feb8563b75f2d
# # Copyright 2021 Lukas Schmelzeisen # # 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 ...
[((1264, 1283), 'logging.getLogger', 'getLogger', (['__name__'], {}), '(__name__)\n', (1273, 1283), False, 'from logging import getLogger\n'), ((1307, 1361), 'typing.TypeVar', 'TypeVar', (['"""_T_WikidataDumpFile"""'], {'bound': 'WikidataDumpFile'}), "('_T_WikidataDumpFile', bound=WikidataDumpFile)\n", (1314, 1361), Fa...
Ahrvo-Trading-Systems/tcapy
tcapygen/layoutgen.py
df8439aa5c754fc9a7fde463c44c489b27112f76
from __future__ import division, print_function __author__ = 'saeedamen' # Saeed Amen / saeed@cuemacro.com # # Copyright 2017 Cuemacro Ltd. - http//www.cuemacro.com / @cuemacro # # See the License for the specific language governing permissions and limitations under the License. # ## Web server components import da...
[((1519, 1563), 'pandas.date_range', 'pd.date_range', (['"""0:00"""', '"""23:59"""'], {'freq': '"""15min"""'}), "('0:00', '23:59', freq='15min')\n", (1532, 1563), True, 'import pandas as pd\n'), ((1390, 1441), 'datetime.timedelta', 'timedelta', ([], {'days': 'self._constants.gui_lookback_window'}), '(days=self._constan...
andrewtarzia/stk
tests/molecular/molecules/molecule/fixtures/cof/periodic_kagome.py
1ac2ecbb5c9940fe49ce04cbf5603fd7538c475a
import pytest import stk from ...case_data import CaseData @pytest.fixture( scope='session', params=( lambda name: CaseData( molecule=stk.ConstructedMolecule( topology_graph=stk.cof.PeriodicKagome( building_blocks=( stk.BuildingB...
[((2901, 2924), 'stk.PeriodicCollapser', 'stk.PeriodicCollapser', ([], {}), '()\n', (2922, 2924), False, 'import stk\n'), ((429, 447), 'stk.BromoFactory', 'stk.BromoFactory', ([], {}), '()\n', (445, 447), False, 'import stk\n'), ((751, 769), 'stk.BromoFactory', 'stk.BromoFactory', ([], {}), '()\n', (767, 769), False, '...
Oneflow-Inc/libai
projects/MAE/utils/weight_convert.py
e473bd3962f07b1e37232d2be39c8257df0ec0f3
# coding=utf-8 # Copyright 2021 The OneFlow 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 require...
[((683, 710), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (700, 710), False, 'import logging\n'), ((2885, 2921), 'torch.load', 'torch.load', (['path'], {'map_location': '"""cpu"""'}), "(path, map_location='cpu')\n", (2895, 2921), False, 'import torch\n'), ((3220, 3236), 'oneflow.tensor...
taskmaker1/dthm4kaiako
dthm4kaiako/events/__init__.py
681babc10b3223b5ae7fdf19b98c53d2bef4ea1a
"""Module for events application."""
[]
K0gata/SGLI_Python_output_tool
spot/level1.py
1368e0408edd737a5109d0523db6c147faa80b97
import numpy as np import logging from decimal import Decimal, ROUND_HALF_UP from abc import ABC, abstractmethod, abstractproperty from spot.utility import bilin_2d from spot.config import PROJ_TYPE # ============================= # Level-1 template class # ============================= class L1Interface(ABC): ...
[((7586, 7616), 'numpy.bitwise_and', 'np.bitwise_and', (['dn_data', '(32768)'], {}), '(dn_data, 32768)\n', (7600, 7616), True, 'import numpy as np\n'), ((1477, 1505), 'numpy.warnings.catch_warnings', 'np.warnings.catch_warnings', ([], {}), '()\n', (1503, 1505), True, 'import numpy as np\n'), ((1519, 1606), 'numpy.warni...
Alvin1994/leetcode-python3-
168. Excel Sheet Column Title.py
ba2bde873c925554cc39f2bd13be81967713477d
class Solution: # @return a string def convertToTitle(self, n: int) -> str: capitals = [chr(x) for x in range(ord('A'), ord('Z')+1)] result = [] while n > 0: result.insert(0, capitals[(n-1)%len(capitals)]) n = (n-1) % len(capitals) # result.reverse() ...
[]
Martijnve23/catapult
devil/devil/utils/cmd_helper.py
5c63b19d221af6a12889e8727acc85d93892cab7
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A wrapper for subprocess to make calling shell commands easier.""" import codecs import logging import os import pipes import select import signal imp...
[((485, 539), 'os.path.join', 'os.path.join', (['CATAPULT_ROOT_PATH', '"""third_party"""', '"""six"""'], {}), "(CATAPULT_ROOT_PATH, 'third_party', 'six')\n", (497, 539), False, 'import os\n'), ((650, 677), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (667, 677), False, 'import logging\n...
AyanSamanta23/moni-moni
services/server/server/apps/checkout/migrations/0001_initial.py
8e8aa4edf4cd2e2b005f6dbe8c885ecc791e6a2b
# Generated by Django 4.0.2 on 2022-02-26 15:52 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='FundingOptions', fields=[ ('id', models.Big...
[((310, 406), 'django.db.models.BigAutoField', 'models.BigAutoField', ([], {'auto_created': '(True)', 'primary_key': '(True)', 'serialize': '(False)', 'verbose_name': '"""ID"""'}), "(auto_created=True, primary_key=True, serialize=False,\n verbose_name='ID')\n", (329, 406), False, 'from django.db import migrations, m...
urchinpro/L2-forms
api/to_astm.py
37f33386984efbb2d1e92c73d915256247801109
import itertools from astm import codec from collections import defaultdict from django.utils import timezone import directions.models as directions import directory.models as directory import api.models as api import simplejson as json def get_astm_header() -> list: return ['H|\\^&', None, None, ['1', '2.00'], N...
[((651, 714), 'directions.models.Issledovaniya.objects.filter', 'directions.Issledovaniya.objects.filter', ([], {'napravleniye': 'direction'}), '(napravleniye=direction)\n', (690, 714), True, 'import directions.models as directions\n'), ((1593, 1613), 'astm.codec.iter_encode', 'codec.iter_encode', (['m'], {}), '(m)\n',...
CospanDesign/nysa
test/unit/test_som_rom_parser.py
ffe07f0b8fe2f6217e7a862d89b80f1b17163be9
#!/usr/bin/python import unittest import json import sys import os import string sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) from nysa.cbuilder import sdb_component as sdbc from nysa.cbuilder import sdb_object_model as som ...
[]
jeetsagar/turbojet
src/TF-gui/tftrain.py
9b17edde0a7e01d0fa320261fbc2734ce53577d2
#!python3 import os import pandas as pd import tensorflow as tf from tensorflow.keras import layers os.environ["CUDA_VISIBLE_DEVICES"] = "0" # gpu_devices = tf.config.experimental.list_physical_devices("GPU") # for device in gpu_devices: # tf.config.experimental.set_memory_growth(device, True) def trainModel...
[((5713, 5827), 'tensorflow.keras.callbacks.ModelCheckpoint', 'tf.keras.callbacks.ModelCheckpoint', (['filepath'], {'monitor': '"""loss"""', 'verbos': '(0)', 'save_best_only': '(True)', 'save_freq': '"""epoch"""'}), "(filepath, monitor='loss', verbos=0,\n save_best_only=True, save_freq='epoch')\n", (5747, 5827), Tru...
sebastienc/ansible-kong-module
library/kong_api.py
c1e7b471a517d1ec99c5629f3729ebc34088bd64
#!/usr/bin/python DOCUMENTATION = ''' --- module: kong short_description: Configure a Kong API Gateway ''' EXAMPLES = ''' - name: Register a site kong: kong_admin_uri: http://127.0.0.1:8001/apis/ name: "Mockbin" taget_url: "http://mockbin.com" request_host: "mockbin.com" state: present - ...
[((1928, 1961), 'requests.get', 'requests.get', (['url'], {'auth': 'self.auth'}), '(url, auth=self.auth)\n', (1940, 1961), False, 'import json, requests, os\n'), ((2053, 2086), 'requests.get', 'requests.get', (['url'], {'auth': 'self.auth'}), '(url, auth=self.auth)\n', (2065, 2086), False, 'import json, requests, os\n'...
XingxinHE/compas
src/compas_plotters/artists/lineartist.py
d2901dbbacdaf4694e5adae78ba8f093f10532bf
from compas_plotters.artists import Artist from matplotlib.lines import Line2D from compas.geometry import intersection_line_box_xy __all__ = ['LineArtist'] class LineArtist(Artist): """""" zorder = 1000 def __init__(self, line, draw_points=False, draw_as_segment=False, linewidth=1.0, linestyle='solid...
[((931, 971), 'compas.geometry.intersection_line_box_xy', 'intersection_line_box_xy', (['self.line', 'box'], {}), '(self.line, box)\n', (955, 971), False, 'from compas.geometry import intersection_line_box_xy\n'), ((1219, 1340), 'matplotlib.lines.Line2D', 'Line2D', (['[x0, x1]', '[y0, y1]'], {'linewidth': 'self.linewid...
manome/python-silvq
plot2d_artificial_dataset1_silvq.py
b50d7486e970fbe9a5b66dd3fc5beb8b5de8ca2f
# -*- encoding: utf8 -*- import numpy as np from sklearn.metrics import accuracy_score from sklearn.model_selection import train_test_split from lvq import SilvqModel from lvq.utils import plot2d def main(): # Load dataset dataset = np.loadtxt('data/artificial_dataset1.csv', delimiter=',') x = dataset[:...
[((245, 302), 'numpy.loadtxt', 'np.loadtxt', (['"""data/artificial_dataset1.csv"""'], {'delimiter': '""","""'}), "('data/artificial_dataset1.csv', delimiter=',')\n", (255, 302), True, 'import numpy as np\n'), ((474, 553), 'sklearn.model_selection.train_test_split', 'train_test_split', (['x', 'y'], {'test_size': '(0.2)'...
ifr1m/hyper-kvasir
classification_experiments/Fine-Tuned-ResNet-50/Fine-Tuned-ResNet-50.py
21cc366e78c0cb4e180a26a0e441d6c0d5171da9
#!/usr/bin/env python # coding: utf-8 # In[ ]: #Importing all required libraries # In[ ]: from __future__ import absolute_import, division, print_function, unicode_literals # In[ ]: #Checking for correct cuda and tf versions from tensorflow.python.platform import build_info as tf_build_info print(tf_build_in...
[((1111, 1139), 'pathlib.Path', 'pathlib.Path', (['train_data_dir'], {}), '(train_data_dir)\n', (1123, 1139), False, 'import pathlib\n'), ((1156, 1183), 'pathlib.Path', 'pathlib.Path', (['test_data_dir'], {}), '(test_data_dir)\n', (1168, 1183), False, 'import pathlib\n'), ((1680, 1713), 'numpy.ceil', 'np.ceil', (['(ima...
SlimKatLegacy/android_external_chromium_org
tools/android/android_tools.gyp
ee480ef5039d7c561fc66ccf52169ead186f1bea
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'targets': [ # Intermediate target grouping the android tools needed to run native # unittests and instrumentation test apks. { 'ta...
[]
FantasyGold/FantasyGold-Core
test/functional/fantasygold_opcall.py
afff8871e770045e468e2f536ede9db0dff889d5
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from tes...
[]
AlbertDeFusco/intake-sklearn
intake_sklearn/source.py
6cd0e11b26703712eb338032518e5c55b725c48f
from intake.source.base import DataSource, Schema import joblib import fsspec import sklearn import re from . import __version__ class SklearnModelSource(DataSource): container = 'python' name = 'sklearn' version = __version__ partition_access = False def __init__(self, urlpath, storage_options=N...
[((994, 1081), 're.search', 're.search', (["b'_sklearn_versionq(.*\\x00)((\\\\d+\\\\.)?(\\\\d+\\\\.)?(\\\\*|\\\\d+))q'", 'as_binary'], {}), "(b'_sklearn_versionq(.*\\x00)((\\\\d+\\\\.)?(\\\\d+\\\\.)?(\\\\*|\\\\d+))q',\n as_binary)\n", (1003, 1081), False, 'import re\n'), ((1209, 1283), 'intake.source.base.Schema', '...
hatamov/jedi
jedi/evaluate/dynamic.py
10df0f933f931a8e0e70304d823f6df0dc3000bd
""" One of the really important features of |jedi| is to have an option to understand code like this:: def foo(bar): bar. # completion here foo(1) There's no doubt wheter bar is an ``int`` or not, but if there's also a call like ``foo('str')``, what would happen? Well, we'll just show both. Because th...
[((1874, 1922), 'jedi.evaluate.cache.memoize_default', 'memoize_default', (['[]'], {'evaluator_is_first_arg': '(True)'}), '([], evaluator_is_first_arg=True)\n', (1889, 1922), False, 'from jedi.evaluate.cache import memoize_default\n'), ((1446, 1493), 'jedi.debug.dbg', 'debug.dbg', (['"""Dynamic param search for %s"""',...
moird/linux-game-report
steamcheck/views.py
8c3204d857134b0685bc3c213cd9d9e9f9a5f2fd
from steamcheck import app from flask import jsonify, render_template import os import steamapi import json @app.route('/') def index(): return render_template("index.html") @app.route('/report/<name>') def report(name=None): """ This will generate the report based on the users Steam ID. Returns JSON ...
[((111, 125), 'steamcheck.app.route', 'app.route', (['"""/"""'], {}), "('/')\n", (120, 125), False, 'from steamcheck import app\n'), ((183, 210), 'steamcheck.app.route', 'app.route', (['"""/report/<name>"""'], {}), "('/report/<name>')\n", (192, 210), False, 'from steamcheck import app\n'), ((150, 179), 'flask.render_te...
benjaminysmith/covidcast-indicators
validator/delphi_validator/run.py
b1474cd68a1497166fefe4beffd4d5ff867b9a61
# -*- coding: utf-8 -*- """Functions to call when running the tool. This module should contain a function called `run_module`, that is executed when the module is run with `python -m delphi_validator`. """ from delphi_utils import read_params from .validate import Validator def run_module(): """Run the validator...
[((357, 370), 'delphi_utils.read_params', 'read_params', ([], {}), '()\n', (368, 370), False, 'from delphi_utils import read_params\n')]
zenithfang/supervised_dispnet
datasets/validation_folders.py
f81dfccfdc944e015d8fae17e24b3e664bec14d6
import torch.utils.data as data import numpy as np from imageio import imread from path import Path import pdb def crawl_folders(folders_list): imgs = [] depth = [] for folder in folders_list: current_imgs = sorted(folder.files('*.jpg')) current_depth = [] fo...
[((1183, 1193), 'path.Path', 'Path', (['root'], {}), '(root)\n', (1187, 1193), False, 'from path import Path\n'), ((654, 666), 'imageio.imread', 'imread', (['path'], {}), '(path)\n', (660, 666), False, 'from imageio import imread\n'), ((1513, 1539), 'numpy.load', 'np.load', (['self.depth[index]'], {}), '(self.depth[ind...
tigertv/crypt
secretpy/ciphers/rot18.py
e464f998e5540f52e269fe360ec9d3a08e976b2e
#!/usr/bin/python from .rot13 import Rot13 import secretpy.alphabets as al class Rot18: """ The Rot18 Cipher """ __rot13 = Rot13() def __init__(self): alphabet = al.ENGLISH half = len(alphabet) >> 1 self.__alphabet = alphabet[:half] + al.DECIMAL[:5] + alphabet[half:] + al...
[]
notoraptor/pysaurus
pysaurus/database/special_properties.py
3bf5fe8c15e0e0e580e5edaea05b4a1298641367
from abc import abstractmethod from pysaurus.database.properties import PropType from pysaurus.database.video import Video class SpecialPropType(PropType): __slots__ = () @abstractmethod def get(self, video: Video): raise NotImplementedError() class PropError(SpecialPropType): __slots__ = ...
[]
openstack/patrole
patrole_tempest_plugin/rbac_utils.py
fa0ee135121a5e86301ad5ee1854b3a0bd70b69b
# Copyright 2017 AT&T Corporation. # 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 require...
[((895, 922), 'oslo_log.log.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (912, 922), True, 'from oslo_log import log as logging\n'), ((3463, 3523), 'patrole_tempest_plugin.rbac_exceptions.RbacPartialResponseBody', 'rbac_exceptions.RbacPartialResponseBody', ([], {'body': 'self.resources'}), '(bod...
kimera1999/pmpktn
core/my_widgets/drug_picker.py
5307b6684a08bac4b88617f097017b5ea4192ab2
from initialize import * from core.db.db_func import query_linedrug_list import os import wx class DrugPopup(wx.ComboPopup): def __init__(self, parent): super().__init__() self.lc = None self.mv = parent.mv self.init_d_l = query_linedrug_list(self.mv.sess).all() self.d_l =...
[((373, 450), 'wx.ListCtrl', 'wx.ListCtrl', (['parent'], {'style': '(wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.SIMPLE_BORDER)'}), '(parent, style=wx.LC_REPORT | wx.LC_SINGLE_SEL | wx.SIMPLE_BORDER)\n', (384, 450), False, 'import wx\n'), ((262, 295), 'core.db.db_func.query_linedrug_list', 'query_linedrug_list', (['self.mv.se...
GuilhermeEsdras/Grafos
em Python/Roteiro4/Roteiro4__grafos.py
b6556c3d679496d576f65b798a1a584cd73e40f4
from Roteiro4.Roteiro4__funcoes import Grafo class Grafos: # Grafo da Paraรญba paraiba = Grafo(['J', 'C', 'E', 'P', 'M', 'T', 'Z']) for aresta in ['J-C', 'C-E', 'C-E', 'C-P', 'C-P', 'C-M', 'C-T', 'M-T', 'T-Z']: paraiba.adicionaAresta(aresta) # --- # # Grafo Completo grafo...
[((103, 145), 'Roteiro4.Roteiro4__funcoes.Grafo', 'Grafo', (["['J', 'C', 'E', 'P', 'M', 'T', 'Z']"], {}), "(['J', 'C', 'E', 'P', 'M', 'T', 'Z'])\n", (108, 145), False, 'from Roteiro4.Roteiro4__funcoes import Grafo\n'), ((332, 359), 'Roteiro4.Roteiro4__funcoes.Grafo', 'Grafo', (["['J', 'C', 'E', 'P']"], {}), "(['J', 'C'...
youtaya/knight
fuzzybee/joboard/views.py
6899e18ca6b1ef01daaae7d7fd14b50a26aa0aee
# -*- coding: utf-8 -*- from django.shortcuts import get_object_or_404, render_to_response, render from django.http import HttpResponseRedirect, HttpResponse from django.core.urlresolvers import reverse from django.shortcuts import redirect from joboard.models import Factory from joboard.forms import FactoryForm from d...
[]
yatsu/react-flask-graphql-example
flask/app.py
18a38b7602c81a85a3cc38c74440ce34d63fc32a
from flask import Flask from flask_cors import CORS from flask_graphql import GraphQLView from schema import Schema def create_app(**kwargs): app = Flask(__name__) app.debug = True app.add_url_rule( '/graphql', view_func=GraphQLView.as_view('graphql', schema=Schema, **kwargs) ) ret...
[((154, 169), 'flask.Flask', 'Flask', (['__name__'], {}), '(__name__)\n', (159, 169), False, 'from flask import Flask\n'), ((397, 448), 'flask_cors.CORS', 'CORS', (['app'], {'resources': "{'/graphql': {'origins': '*'}}"}), "(app, resources={'/graphql': {'origins': '*'}})\n", (401, 448), False, 'from flask_cors import C...
AndrewChap/mortgagetvm
mortgagetvm/mortgageOptions.py
4ec39707d61bcb3224bdcddce84bf237f02352d1
# Factory-like class for mortgage options class MortgageOptions: def __init__(self,kind,**inputOptions): self.set_default_options() self.set_kind_options(kind = kind) self.set_input_options(**inputOptions) def set_default_options(self): self.optionList = dict() self.optionList['commonDefaul...
[]
CodingBullywug/DDreshape
DD/Terrain.py
393e5ea336eb6cb78f31345731ccf52baf19bfac
from DD.utils import PoolByteArray2NumpyArray, NumpyArray2PoolByteArray from DD.Entity import Entity import numpy as np class Terrain(Entity): def __init__(self, json, width, height, scale=4, terrain_types=4): super(Terrain, self).__init__(json) self._scale = scale self.terrain_types = terr...
[((720, 852), 'numpy.pad', 'np.pad', (['self.splat', '((top * self._scale, bottom * self._scale), (left * self._scale, right *\n self._scale), (0, 0))'], {'mode': '"""edge"""'}), "(self.splat, ((top * self._scale, bottom * self._scale), (left * self\n ._scale, right * self._scale), (0, 0)), mode='edge')\n", (726,...
AbbyGi/bluesky
bluesky/tests/utils.py
759f9c55dce97dc47513cca749a69dd861bdf58d
from collections import defaultdict import contextlib import tempfile import sys import threading import asyncio @contextlib.contextmanager def _print_redirect(): old_stdout = sys.stdout try: fout = tempfile.TemporaryFile(mode="w+", encoding="utf-8") sys.stdout = fout yield fout fi...
[((1289, 1306), 'threading.Event', 'threading.Event', ([], {}), '()\n', (1304, 1306), False, 'import threading\n'), ((217, 268), 'tempfile.TemporaryFile', 'tempfile.TemporaryFile', ([], {'mode': '"""w+"""', 'encoding': '"""utf-8"""'}), "(mode='w+', encoding='utf-8')\n", (239, 268), False, 'import tempfile\n'), ((712, 7...
MJJojo97/openslides-backend
cli/check_json.py
af0d1edb0070e352d46f285a1ba0bbe3702d49ae
import json import sys from openslides_backend.models.checker import Checker, CheckException def main() -> int: files = sys.argv[1:] if not files: print("No files specified.") return 1 possible_modes = tuple(f"--{mode}" for mode in Checker.modes) modes = tuple(mode[2:] for mode in p...
[((765, 780), 'json.load', 'json.load', (['data'], {}), '(data)\n', (774, 780), False, 'import json\n')]
robinagist/manic
utils/mgmt.py
b1bdefbb11c7489164a0c08bb092ffecb5900261
from utils.data import load_memfile_configs from utils.server import plain_response from sanic import response def get_mappedfile_configs(): cfgs = load_memfile_configs() return response.json(plain_response(cfgs, 0), status=200) def created_mapped_file(): pass def delete_mapped_file(): pass
[((156, 178), 'utils.data.load_memfile_configs', 'load_memfile_configs', ([], {}), '()\n', (176, 178), False, 'from utils.data import load_memfile_configs\n'), ((204, 227), 'utils.server.plain_response', 'plain_response', (['cfgs', '(0)'], {}), '(cfgs, 0)\n', (218, 227), False, 'from utils.server import plain_response\...
UpCoder/YNe
datasets/medicalImage.py
2f932456eda29b1e04f4c7e212e2ab0dacfe831b
# -*- coding=utf-8 -*- import SimpleITK as itk import pydicom import numpy as np from PIL import Image, ImageDraw import gc from skimage.morphology import disk, dilation import nipy import os from glob import glob import scipy import cv2 from xml.dom.minidom import Document typenames = ['CYST', 'FNH', 'HCC', 'HEM', 'M...
[]
marcus-luck/zohoreader
setup.py
e832f076a8a87bf27607980fb85a1d2bc8339743
from setuptools import setup def readme(): with open('README.rst') as f: return f.read() setup(name='zohoreader', version='0.1', description='A simple reader for zoho projects API to get all projects, users and timereports', long_description=readme(), classifiers=[ 'Devel...
[]
Ubehebe/rules_webtesting
web/repositories.bzl
c231866a3bccc0f27b31050a57dc2b4a700ad64e
# Copyright 2016 Google Inc. # # 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 writing,...
[]
santomon/taskonomy
code/tools/run_viz_single_task.py
4b22087a2686172b21b61589831061e7a386fe36
from __future__ import absolute_import, division, print_function import argparse import importlib import itertools import time from multiprocessing import Pool import numpy as np import os import pdb import pickle import subprocess import sys import tensorflow as tf import tensorflow.contrib.slim as slim import thr...
[((790, 844), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Viz Single Task"""'}), "(description='Viz Single Task')\n", (813, 844), False, 'import argparse\n'), ((1198, 1240), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.ERROR'], {}), '(tf.logging.ERROR)...
cholve/stratum
stratum/portage/build_defs.bzl
09ddb5acb604f7e694a6b7d2fe93fea79f801794
# Copyright 2018 Google LLC # Copyright 2018-present Open Networking Foundation # SPDX-License-Identifier: Apache-2.0 """A portable build system for Stratum P4 switch stack. To use this, load() this file in a BUILD file, specifying the symbols needed. The public symbols are the macros: decorate(path) sc_cc_lib ...
[]
miuvlad/genieparser
src/genie/libs/parser/ios/tests/test_show_platform.py
60b1151e3c67c6b55d75e30359d0bf52825efad8
#!/bin/env python import unittest from unittest.mock import Mock from pyats.topology import Device from genie.metaparser.util.exceptions import SchemaEmptyParserError,\ SchemaMissingKeyError from genie.libs.parser.ios.show_platform import ShowVersion,\ Dir,\ ShowRedundan...
[((2878, 2898), 'pyats.topology.Device', 'Device', ([], {'name': '"""empty"""'}), "(name='empty')\n", (2884, 2898), False, 'from pyats.topology import Device\n'), ((2914, 2933), 'pyats.topology.Device', 'Device', ([], {'name': '"""iosv"""'}), "(name='iosv')\n", (2920, 2933), False, 'from pyats.topology import Device\n'...
emmamcbryde/AuTuMN-1
autumn/projects/covid_19/sri_lanka/sri_lanka/project.py
b1e7de15ac6ef6bed95a80efab17f0780ec9ff6f
import numpy as np from autumn.calibration.proposal_tuning import perform_all_params_proposal_tuning from autumn.core.project import Project, ParameterSet, load_timeseries, build_rel_path, get_all_available_scenario_paths, \ use_tuned_proposal_sds from autumn.calibration import Calibration from autumn.calibration.p...
[((738, 774), 'autumn.core.project.build_rel_path', 'build_rel_path', (['"""params/default.yml"""'], {}), "('params/default.yml')\n", (752, 774), False, 'from autumn.core.project import Project, ParameterSet, load_timeseries, build_rel_path, get_all_available_scenario_paths, use_tuned_proposal_sds\n'), ((870, 909), 'au...
thanosbnt/SharingCitiesDashboard
Analytics/resources/themes/test_subthemes.py
5d123691d1f25d0b85e20e4e8293266bf23c9f8a
import unittest from http import HTTPStatus from unittest import TestCase import bcrypt from flask.ctx import AppContext from flask.testing import FlaskClient from app import create_app from models.theme import Theme, SubTheme from models.users import Users class TestSubTemes(TestCase): """ Unittest for the...
[((9229, 9244), 'unittest.main', 'unittest.main', ([], {}), '()\n', (9242, 9244), False, 'import unittest\n'), ((759, 799), 'models.theme.Theme.get_by_name', 'Theme.get_by_name', (['"""_test_add_Subtheme_"""'], {}), "('_test_add_Subtheme_')\n", (776, 799), False, 'from models.theme import Theme, SubTheme\n'), ((1259, 1...
TC921/openpilot
selfdrive/sensord/rawgps/structs.py
d5d91e6e3be02e2525ed8d6137e5fdca2b81657c
from struct import unpack_from, calcsize LOG_GNSS_POSITION_REPORT = 0x1476 LOG_GNSS_GPS_MEASUREMENT_REPORT = 0x1477 LOG_GNSS_CLOCK_REPORT = 0x1478 LOG_GNSS_GLONASS_MEASUREMENT_REPORT = 0x1480 LOG_GNSS_BDS_MEASUREMENT_REPORT = 0x1756 LOG_GNSS_GAL_MEASUREMENT_REPORT = 0x1886 LOG_GNSS_OEMDRE_MEASUREMENT_REPORT = 0x14DE ...
[((11349, 11361), 'struct.calcsize', 'calcsize', (['st'], {}), '(st)\n', (11357, 11361), False, 'from struct import unpack_from, calcsize\n'), ((11396, 11414), 'struct.unpack_from', 'unpack_from', (['st', 'x'], {}), '(st, x)\n', (11407, 11414), False, 'from struct import unpack_from, calcsize\n')]
anvdev/Hammer-Tools
python2.7libs/hammer_tools/content_browser.py
0211ec837da6754e537c98624ecd07c23abab28e
from __future__ import print_function try: from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * except ImportError: from PySide2.QtWidgets import * from PySide2.QtGui import * from PySide2.QtCore import * import hou from hammer_tools.utils import createAction d...
[((5595, 5613), 'hou.qt.Separator', 'hou.qt.Separator', ([], {}), '()\n', (5611, 5613), False, 'import hou\n'), ((2230, 2255), 'hou.ui.closeValueLadder', 'hou.ui.closeValueLadder', ([], {}), '()\n', (2253, 2255), False, 'import hou\n'), ((3082, 3101), 'hou.qt.styleSheet', 'hou.qt.styleSheet', ([], {}), '()\n', (3099, 3...
luhuadong/stm32f769-disco-demo
rt-thread/applications/server/udp_sender.py
c7fb0d627b02c3f87959f43f1447bc79f62a7099
#!/usr/bin/python3 """ UDP sender """ import socket import time import sys smsg = b'\xaa\x08\xfe\x00\xc9\xe6\x5f\xee' def main(): ip_port = ('192.168.3.188', 8888) if len(sys.argv) < 2: port = 8888 else: port = int(sys.argv[1]) # 1. ๅˆ›ๅปบ udp ๅฅ—ๆŽฅๅญ— udp_socket = socket.socket(s...
[((305, 353), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_DGRAM'], {}), '(socket.AF_INET, socket.SOCK_DGRAM)\n', (318, 353), False, 'import socket\n'), ((948, 965), 'time.sleep', 'time.sleep', (['(0.005)'], {}), '(0.005)\n', (958, 965), False, 'import time\n')]
LunaProject-Discord/yudzuki.py
yudzuki/role.py
7ff2d1f9e39ed5300a46c48fb95df50046814ede
__all__ = ( "Role", ) class Role: def __init__(self, data): self.data = data self._update(data) def _get_json(self): return self.data def __repr__(self): return ( f"<Role id={self.id} name={self.name}>" ) def __str__(self): ...
[]
cabilangan112/intern-drf-blog
jassen/django/project/project/urls.py
b2d6c7a4af1316b2c7ce38547bd9df99b4f3e8b9
"""project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based...
[((919, 942), 'rest_framework.routers.DefaultRouter', 'routers.DefaultRouter', ([], {}), '()\n', (940, 942), False, 'from rest_framework import routers\n'), ((1390, 1421), 'django.urls.path', 'path', (['"""admin/"""', 'admin.site.urls'], {}), "('admin/', admin.site.urls)\n", (1394, 1421), False, 'from django.urls impor...
everbrez/Deep-Learning-based-Chemical-Graphics-Analysis-Platform
deep-learning-app/src/models/__init__.py
5ecaedadd74e96891c28d9f73384e07c1526916b
print('init')
[]
Andy-Wilkinson/ChemMLToolk
chemmltoolkit/tensorflow/callbacks/variableScheduler.py
83efc7ea66d2def860a3e04ccd70d77fb689fddc
import tensorflow as tf class VariableScheduler(tf.keras.callbacks.Callback): """Schedules an arbitary variable during training. Arguments: variable: The variable to modify the value of. schedule: A function that takes an epoch index (integer, indexed from 0) and current variable ...
[]
nijibabulu/chip_tools
join_peaks.py
04def22059a6018b3b49247d69d7b04eee1dcd89
#! /usr/bin/env python import os import sys import math import csv import collections import docopt import peakzilla_qnorm_mapq_patched as pz __doc__ = ''' Usage: join_peaks.py [options] PEAKS CHIP INPUT [ (PEAKS CHIP INPUT) ... ] This script finds peaks in common between multiple ChIP experiments determined by pe...
[]
uptown/django-town
django_town/rest_swagger/views.py
4c3b078a8ce5dcc275d65faa4a1cdfb7ebc74a50
from django_town.rest import RestApiView, rest_api_manager from django_town.http import http_json_response from django_town.cache.utlis import SimpleCache from django_town.oauth2.swagger import swagger_authorizations_data from django_town.social.oauth2.permissions import OAuth2Authenticated, OAuth2AuthenticatedOrReadOn...
[((9207, 9230), 'django_town.http.http_json_response', 'http_json_response', (['ret'], {}), '(ret)\n', (9225, 9230), False, 'from django_town.http import http_json_response\n'), ((548, 577), 'django_town.rest.rest_api_manager', 'rest_api_manager', (['api_version'], {}), '(api_version)\n', (564, 577), False, 'from djang...
mastermind88/dash
components/dash-core-components/tests/integration/dropdown/test_dynamic_options.py
760af721980e18d91bdbc4e204d1d063c7ed325c
from dash import Dash, Input, Output, dcc, html from dash.exceptions import PreventUpdate def test_dddo001_dynamic_options(dash_dcc): dropdown_options = [ {"label": "New York City", "value": "NYC"}, {"label": "Montreal", "value": "MTL"}, {"label": "San Francisco", "value": "SF"}, ] ...
[((328, 342), 'dash.Dash', 'Dash', (['__name__'], {}), '(__name__)\n', (332, 342), False, 'from dash import Dash, Input, Output, dcc, html\n'), ((360, 410), 'dash.dcc.Dropdown', 'dcc.Dropdown', ([], {'id': '"""my-dynamic-dropdown"""', 'options': '[]'}), "(id='my-dynamic-dropdown', options=[])\n", (372, 410), False, 'fr...
dipghoshraj/live-video-streming-with-web-socket
Server.py
dda924e22a4c40d225ec39dd94ee1e489233c403
import cv2 import io import socket import struct import time import pickle import zlib client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_socket.connect(('127.0.0.1', 8485)) connection = client_socket.makefile('wb') cam = cv2.VideoCapture("E:/songs/Attention Charlie Puth(GabbarWorld.com) 1080p.mp4...
[((103, 152), 'socket.socket', 'socket.socket', (['socket.AF_INET', 'socket.SOCK_STREAM'], {}), '(socket.AF_INET, socket.SOCK_STREAM)\n', (116, 152), False, 'import socket\n'), ((244, 322), 'cv2.VideoCapture', 'cv2.VideoCapture', (['"""E:/songs/Attention Charlie Puth(GabbarWorld.com) 1080p.mp4"""'], {}), "('E:/songs/At...
gunpowder78/google-research
hal/agent/tf2_utils.py
d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[((1519, 1563), 'tensorflow.layers.dense', 'tf.layers.dense', (['sentence_embedding', 'n_total'], {}), '(sentence_embedding, n_total)\n', (1534, 1563), True, 'import tensorflow as tf\n'), ((1579, 1650), 'tensorflow.keras.layers.Dense', 'tf.keras.layers.Dense', (['(2 * sum * n_layer_channel)'], {'activation': 'tf.nn.rel...
Wolkabout/WolkConnect-Python-
wolk/logger_factory.py
11412e3f88911170f587b5e857d07ab41c8f52b5
"""LoggerFactory Module.""" # Copyright 2020 WolkAbout Technology s.r.o. # # 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 # # Unl...
[((2052, 2075), 'logging.getLogger', 'logging.getLogger', (['name'], {}), '(name)\n', (2069, 2075), False, 'import logging\n'), ((2521, 2635), 'logging.Formatter', 'logging.Formatter', (["('%(asctime)s - %(levelname)s [%(filename)s:%(lineno)s' +\n ' - %(funcName)s()] - %(message)s')"], {}), "('%(asctime)s - %(leveln...
andre-marcos-perez/data-pipeline-demo
raw.py
2647cce6e90d39798eda352608dc0f6d6ab5255a
import json import gzip import requests from datetime import datetime import pendulum import boto3 from botocore.exceptions import ClientError from util.log import Log from settings.aws_settings import AWSSettings from settings.telegram_settings import TelegramSettings def lambda_handler(event: dict, context: dict)...
[((341, 365), 'util.log.Log.setup', 'Log.setup', ([], {'name': '"""logger"""'}), "(name='logger')\n", (350, 365), False, 'from util.log import Log\n'), ((385, 398), 'settings.aws_settings.AWSSettings', 'AWSSettings', ([], {}), '()\n', (396, 398), False, 'from settings.aws_settings import AWSSettings\n'), ((423, 441), '...