hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08feb69fba090a302d1624d52d146ac7a0787223 | 4,009 | py | Python | tools/deploy/caffe2_converter.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | 707 | 2019-09-04T00:52:35.000Z | 2022-03-31T07:46:41.000Z | tools/deploy/caffe2_converter.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | 60 | 2019-10-18T05:32:10.000Z | 2022-03-25T03:10:20.000Z | tools/deploy/caffe2_converter.py | bruce1408/detectron2_modify | 815df8c3cd68b1450e039fbafc27c6ab302d620b | [
"Apache-2.0"
] | 149 | 2019-09-06T07:24:52.000Z | 2022-03-22T04:55:03.000Z | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import argparse
import os
import onnx
import torch
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import get_cfg
from detectron2.data import build_detection_test_loader
from detectron2.evaluati... | 40.494949 | 96 | 0.690197 | import argparse
import os
import onnx
import torch
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import get_cfg
from detectron2.data import build_detection_test_loader
from detectron2.evaluation import COCOEvaluator, inference_on_dataset, print_csv_format
from detectron2.export import ... | true | true |
08feb6f90eced6bcc66e4b8ec2cab34baed46a7e | 4,522 | py | Python | tests/dicts/io/test_io_dict_toml.py | next-franciscoalgaba/python-benedict | 81ff459304868327238c322a0a8a203d9d5d4314 | [
"MIT"
] | 365 | 2019-05-21T05:50:30.000Z | 2022-03-29T11:35:35.000Z | tests/dicts/io/test_io_dict_toml.py | next-franciscoalgaba/python-benedict | 81ff459304868327238c322a0a8a203d9d5d4314 | [
"MIT"
] | 78 | 2019-11-16T12:22:54.000Z | 2022-03-14T12:21:30.000Z | tests/dicts/io/test_io_dict_toml.py | next-franciscoalgaba/python-benedict | 81ff459304868327238c322a0a8a203d9d5d4314 | [
"MIT"
] | 26 | 2019-12-16T06:34:12.000Z | 2022-02-28T07:16:41.000Z | # -*- coding: utf-8 -*-
from benedict.dicts.io import IODict
from .test_io_dict import io_dict_test_case
class io_dict_toml_test_case(io_dict_test_case):
def test_from_toml_with_valid_data(self):
j = """
a = 1
[b]
c = 3
d = 4
"""
# static method
d = IODict.from_toml(j)
self.ass... | 32.768116 | 74 | 0.602388 |
from benedict.dicts.io import IODict
from .test_io_dict import io_dict_test_case
class io_dict_toml_test_case(io_dict_test_case):
def test_from_toml_with_valid_data(self):
j = """
a = 1
[b]
c = 3
d = 4
"""
d = IODict.from_toml(j)
self.assertTrue(isinstance(d, dict))
sel... | true | true |
08feb97c8e0d6f45fed2b78eab412f01f130070a | 3,247 | py | Python | mnist_tensorflow.py | snehasish069/tensorflow-mnist-dataset | 9f22235d52c66f37a07359056d5c9ef75a1ccf1a | [
"MIT"
] | null | null | null | mnist_tensorflow.py | snehasish069/tensorflow-mnist-dataset | 9f22235d52c66f37a07359056d5c9ef75a1ccf1a | [
"MIT"
] | null | null | null | mnist_tensorflow.py | snehasish069/tensorflow-mnist-dataset | 9f22235d52c66f37a07359056d5c9ef75a1ccf1a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Dec 7 11:19:20 2017
@author: Snehasish
"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("/tmp/data/", one_hot = True)
#learning rate
LR = 0.001
#respective size of hidden layers
hl1 = ... | 34.913978 | 136 | 0.606406 |
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets("/tmp/data/", one_hot = True)
LR = 0.001
hl1 = 500
hl2 = 500
hl3 = 500
output_size = 10 batch_size = 100
no_of_epochs = 10
total_no_of_data = data.train.num_examples
test_x = data... | true | true |
08feb9930e3069ccf2cfdda6ba932ec9fc822c6d | 2,877 | py | Python | alm/solrindex/schema.py | collective/alm.solrindex | 9485febd49ba07d3e76af2a268497663e3829776 | [
"BSD-3-Clause"
] | 1 | 2015-09-11T14:55:55.000Z | 2015-09-11T14:55:55.000Z | alm/solrindex/schema.py | collective/alm.solrindex | 9485febd49ba07d3e76af2a268497663e3829776 | [
"BSD-3-Clause"
] | 3 | 2015-06-24T14:14:20.000Z | 2019-08-21T16:51:58.000Z | alm/solrindex/schema.py | collective/alm.solrindex | 9485febd49ba07d3e76af2a268497663e3829776 | [
"BSD-3-Clause"
] | 3 | 2015-06-24T14:08:22.000Z | 2017-11-01T15:07:52.000Z |
"""Parser of a Solr schema.xml"""
from alm.solrindex.interfaces import ISolrField
from alm.solrindex.interfaces import ISolrFieldHandler
from alm.solrindex.interfaces import ISolrSchema
try:
from elementtree.ElementTree import parse
except ImportError:
from lxml.etree import parse
from zope.component import ... | 29.659794 | 75 | 0.582899 |
from alm.solrindex.interfaces import ISolrField
from alm.solrindex.interfaces import ISolrFieldHandler
from alm.solrindex.interfaces import ISolrSchema
try:
from elementtree.ElementTree import parse
except ImportError:
from lxml.etree import parse
from zope.component import getUtility
from zope.component imp... | true | true |
08feba61e6abf581def96dac1daaf10b5e15bb64 | 2,674 | py | Python | coordinates_generator.py | DanNduati/Parking-Management-System | 0bd9c254c49f9685b4442fbec43e36b5fb2b471b | [
"MIT"
] | null | null | null | coordinates_generator.py | DanNduati/Parking-Management-System | 0bd9c254c49f9685b4442fbec43e36b5fb2b471b | [
"MIT"
] | null | null | null | coordinates_generator.py | DanNduati/Parking-Management-System | 0bd9c254c49f9685b4442fbec43e36b5fb2b471b | [
"MIT"
] | null | null | null | import cv2 as open_cv
import numpy as np
from colours import COLOR_WHITE, COLOR_BLUE
from drawing_utils import draw_contours
class CoordinatesGenerator:
KEY_RESET = ord("r")
KEY_QUIT = ord("q")
def __init__(self, image, output, color):
self.output = output
self.caption = image
se... | 32.609756 | 105 | 0.537771 | import cv2 as open_cv
import numpy as np
from colours import COLOR_WHITE, COLOR_BLUE
from drawing_utils import draw_contours
class CoordinatesGenerator:
KEY_RESET = ord("r")
KEY_QUIT = ord("q")
def __init__(self, image, output, color):
self.output = output
self.caption = image
se... | true | true |
08febb61b155757d0b556cca37703b316e694288 | 221 | py | Python | django_istio_opentracing/client_hooks/_const.py | mizhexiaoxiao/django-istio-opentracing | 635889ff2b1a587fbd2d9f380c69b36f6fca09f8 | [
"MIT"
] | 3 | 2020-11-06T14:59:54.000Z | 2021-05-30T03:13:20.000Z | django_istio_opentracing/client_hooks/_const.py | mizhexiaoxiao/django-istio-opentracing | 635889ff2b1a587fbd2d9f380c69b36f6fca09f8 | [
"MIT"
] | 1 | 2021-05-30T23:30:19.000Z | 2021-06-03T09:38:10.000Z | django_istio_opentracing/client_hooks/_const.py | mizhexiaoxiao/django-istio-opentracing | 635889ff2b1a587fbd2d9f380c69b36f6fca09f8 | [
"MIT"
] | 1 | 2021-09-29T09:09:40.000Z | 2021-09-29T09:09:40.000Z | """transaction tag"""
BEGIN = "BEGIN"
COMMIT = "COMMIT"
ROLLBACK = "ROLLBACK"
TRANS_TAGS = [BEGIN, COMMIT, ROLLBACK]
"""database instance"""
MYSQLDB = "mysql"
PGDB = "postgress"
SQLITE = "sqlite"
REDIS = "redis"
| 11.05 | 38 | 0.651584 |
BEGIN = "BEGIN"
COMMIT = "COMMIT"
ROLLBACK = "ROLLBACK"
TRANS_TAGS = [BEGIN, COMMIT, ROLLBACK]
MYSQLDB = "mysql"
PGDB = "postgress"
SQLITE = "sqlite"
REDIS = "redis"
| true | true |
08febb9255da52306cf27ec257fa9d5aa0f473bb | 11,699 | py | Python | tests/integration_tests/thumbnails_tests.py | Spotrix/spotrix | 611aaac9f47e0451660b37d0ade06750883aba36 | [
"Apache-2.0"
] | 1 | 2021-12-12T10:23:06.000Z | 2021-12-12T10:23:06.000Z | tests/integration_tests/thumbnails_tests.py | Spotrix/spotrix | 611aaac9f47e0451660b37d0ade06750883aba36 | [
"Apache-2.0"
] | null | null | null | tests/integration_tests/thumbnails_tests.py | Spotrix/spotrix | 611aaac9f47e0451660b37d0ade06750883aba36 | [
"Apache-2.0"
] | 1 | 2021-12-12T10:23:19.000Z | 2021-12-12T10:23:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 41.193662 | 88 | 0.669032 | import urllib.request
from io import BytesIO
from unittest import skipUnless
from unittest.mock import ANY, call, patch
from flask_testing import LiveServerTestCase
from sqlalchemy.sql import func
from spotrix import db, is_feature_enabled, security_manager
from spotrix.extensions import machine_auth_provider_factory... | true | true |
08febbbd505c1b08ec3c22551daf437ed62f49c8 | 1,490 | py | Python | master.py | ygCoconut/MRIreconUNET | 4f03cea30590f676f4e63fd5817e06396983acb7 | [
"Apache-2.0"
] | 8 | 2019-11-08T07:49:40.000Z | 2022-02-25T08:11:02.000Z | master.py | ygCoconut/MRIreconUNET | 4f03cea30590f676f4e63fd5817e06396983acb7 | [
"Apache-2.0"
] | 1 | 2020-07-12T16:58:09.000Z | 2020-07-23T14:53:20.000Z | master.py | ygCoconut/MRIreconUNET | 4f03cea30590f676f4e63fd5817e06396983acb7 | [
"Apache-2.0"
] | 2 | 2019-11-08T07:49:48.000Z | 2021-07-22T05:33:30.000Z | """
Idea behind this file.
1) The specs are specific for every run and they are set
in config.txt:
EPOCHS = ..
LR = ..
MODELDIRKEYWORD = ..
ARCH = .. (ARCHITECTURE)
WEIGHT DECAY = ..
..
2) You call in the command prompt:
python masterfile.py config.txt
3) This masterfile is then executed and calls in the commandprom... | 25.254237 | 80 | 0.662416 | import pandas as pd
import os
import sys
CONFIG = sys.argv[1]
specs = pd.read_csv(str(CONFIG))
specs['Parameters'] = specs['Parameters'].str.split(" = ")
RUNALL = specs['Parameters'][0][1]
EPOCHS = specs['Parameters'][1][1]
LR = specs['Parameters'][2][1]
WEIGHT_DECAY = specs['Parameters'][3][1]
BATCH_SIZE = specs['P... | true | true |
08febc7dfe176fa74d843ec24aa4979ccb675c6d | 6,193 | py | Python | phylib/stats/ccg.py | cortex-lab/phylib | 563afac3a7df9ec585fab63b6fe4fc0700f48b7c | [
"BSD-3-Clause"
] | 6 | 2019-05-06T19:05:59.000Z | 2020-11-20T03:21:01.000Z | phylib/stats/ccg.py | cortex-lab/phylib | 563afac3a7df9ec585fab63b6fe4fc0700f48b7c | [
"BSD-3-Clause"
] | 31 | 2019-05-13T14:14:57.000Z | 2021-08-08T15:52:55.000Z | phylib/stats/ccg.py | cortex-lab/phylib | 563afac3a7df9ec585fab63b6fe4fc0700f48b7c | [
"BSD-3-Clause"
] | 14 | 2019-05-09T12:09:37.000Z | 2021-06-17T12:42:47.000Z | # -*- coding: utf-8 -*-
"""Cross-correlograms."""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import numpy as np
from phylib.utils._types import _as_array
from phylib.io.array import _index_... | 32.424084 | 96 | 0.618117 |
import numpy as np
from phylib.utils._types import _as_array
from phylib.io.array import _index_of, _unique
def _increment(arr, indices):
arr = _as_array(arr)
indices = _as_array(indices)
bbins = np.bincount(indices)
arr[:len(bbins)] += bbins
return arr
def _diff_shifted(arr, steps=1):
... | true | true |
08febe0493f2ff21c9bccbad9b062161a4fe5411 | 548 | py | Python | tests/test_96.py | sungho-joo/leetcode2github | ce7730ef40f6051df23681dd3c0e1e657abba620 | [
"MIT"
] | null | null | null | tests/test_96.py | sungho-joo/leetcode2github | ce7730ef40f6051df23681dd3c0e1e657abba620 | [
"MIT"
] | null | null | null | tests/test_96.py | sungho-joo/leetcode2github | ce7730ef40f6051df23681dd3c0e1e657abba620 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pytest
"""
Test 96. Unique Binary Search Trees
"""
@pytest.fixture(scope="session")
def init_variables_96():
from src.leetcode_96_unique_binary_search_trees import Solution
solution = Solution()
def _init_variables_96():
return solution
yield _init_variables_9... | 19.571429 | 67 | 0.718978 |
import pytest
@pytest.fixture(scope="session")
def init_variables_96():
from src.leetcode_96_unique_binary_search_trees import Solution
solution = Solution()
def _init_variables_96():
return solution
yield _init_variables_96
class TestClass96:
def test_solution_0(self, init_variable... | true | true |
08febe1642ac1400881211c729b42333a8cfa358 | 26,516 | py | Python | mpf/devices/ball_device/outgoing_balls_handler.py | pmansukhani/mpf | 0979965d24bcaba9423b43581c6a18b847b1b900 | [
"MIT"
] | null | null | null | mpf/devices/ball_device/outgoing_balls_handler.py | pmansukhani/mpf | 0979965d24bcaba9423b43581c6a18b847b1b900 | [
"MIT"
] | null | null | null | mpf/devices/ball_device/outgoing_balls_handler.py | pmansukhani/mpf | 0979965d24bcaba9423b43581c6a18b847b1b900 | [
"MIT"
] | null | null | null | """Handles outgoing balls."""
import asyncio
from typing import Generator
from typing import List
from mpf.core.utility_functions import Util
from mpf.devices.ball_device.ball_count_handler import EjectTracker
from mpf.devices.ball_device.ball_device_state_handler import BallDeviceStateHandler
from mpf.devices.ball_d... | 48.47532 | 120 | 0.637954 | import asyncio
from typing import Generator
from typing import List
from mpf.core.utility_functions import Util
from mpf.devices.ball_device.ball_count_handler import EjectTracker
from mpf.devices.ball_device.ball_device_state_handler import BallDeviceStateHandler
from mpf.devices.ball_device.incoming_balls_handler i... | true | true |
08febfeb43f9963e3c184aab5f629b04617b9e37 | 5,048 | py | Python | compare_gan/src/gans/DRAGAN.py | hwalsuklee/compare_gan | d6c5976ba2b9d19dbff42f439c20b48565d10235 | [
"Apache-2.0"
] | 2 | 2018-10-03T09:52:44.000Z | 2022-03-03T03:00:23.000Z | compare_gan/src/gans/DRAGAN.py | hwalsuklee/compare_gan | d6c5976ba2b9d19dbff42f439c20b48565d10235 | [
"Apache-2.0"
] | null | null | null | compare_gan/src/gans/DRAGAN.py | hwalsuklee/compare_gan | d6c5976ba2b9d19dbff42f439c20b48565d10235 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google LLC & Hwalsuk Lee.
#
# 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 ... | 38.830769 | 80 | 0.707409 |
from __future__ import division
from compare_gan.src.gans.abstract_gan import AbstractGAN
import numpy as np
import tensorflow as tf
class DRAGAN(AbstractGAN):
def __init__(self, sess, dataset_content, dataset_parameters,
training_parameters, checkpoint_dir, result_dir, log_dir):
super(DRAGAN,... | true | true |
08fec00152c797bfd2af379d1352cac6629063c3 | 2,144 | py | Python | cloud.py | codalab/elasticcloud | 39438a97d93e66e5abb5ba90b76f567761464a4a | [
"MIT"
] | null | null | null | cloud.py | codalab/elasticcloud | 39438a97d93e66e5abb5ba90b76f567761464a4a | [
"MIT"
] | 3 | 2019-03-08T19:48:07.000Z | 2019-05-01T19:25:32.000Z | cloud.py | codalab/elasticcloud | 39438a97d93e66e5abb5ba90b76f567761464a4a | [
"MIT"
] | 1 | 2019-03-05T01:41:27.000Z | 2019-03-05T01:41:27.000Z | #!/usr/bin/env python3
import click
from ElasticCloudAdapter import ElasticCloudAdapter
from GCEAdapter import GCEAdapter
def adapter_choice(driver):
if driver == 'gce':
return GCEAdapter()
else:
raise NotImplementedError
@click.group()
def cli():
pass
@cli.command()
@click.argumen... | 27.487179 | 87 | 0.671175 | import click
from ElasticCloudAdapter import ElasticCloudAdapter
from GCEAdapter import GCEAdapter
def adapter_choice(driver):
if driver == 'gce':
return GCEAdapter()
else:
raise NotImplementedError
@click.group()
def cli():
pass
@cli.command()
@click.argument('driver', type=click.... | true | true |
08fec03dbbc70b1c49154546c0c9b44f74efad58 | 1,105 | py | Python | annot/Annot_3_Generate_Tx_Fasta.py | hshayya/2022_Shayya_UPR_Guidance | b9a305a147a105c3ac9c0173e06b94f66e4a6102 | [
"MIT"
] | null | null | null | annot/Annot_3_Generate_Tx_Fasta.py | hshayya/2022_Shayya_UPR_Guidance | b9a305a147a105c3ac9c0173e06b94f66e4a6102 | [
"MIT"
] | null | null | null | annot/Annot_3_Generate_Tx_Fasta.py | hshayya/2022_Shayya_UPR_Guidance | b9a305a147a105c3ac9c0173e06b94f66e4a6102 | [
"MIT"
] | null | null | null | from __future__ import division
import dill
from collections import defaultdict
from plastid import BAMGenomeArray, Transcript, VariableFivePrimeMapFactory, GenomeHash, GTF2_TranscriptAssembler
import numpy as np
import pandas as pd
import copy
import itertools
import re
from pathos.multiprocessing import ProcessingPoo... | 32.5 | 113 | 0.8 | from __future__ import division
import dill
from collections import defaultdict
from plastid import BAMGenomeArray, Transcript, VariableFivePrimeMapFactory, GenomeHash, GTF2_TranscriptAssembler
import numpy as np
import pandas as pd
import copy
import itertools
import re
from pathos.multiprocessing import ProcessingPoo... | true | true |
08fec2df64f6f32291b3308f79a0f7ccb5da5a3b | 2,436 | py | Python | xml2img_batch.py | ericshijian/label_ellipse | e4a15b41feb01544e639ade19669b1d38f656b45 | [
"MIT"
] | null | null | null | xml2img_batch.py | ericshijian/label_ellipse | e4a15b41feb01544e639ade19669b1d38f656b45 | [
"MIT"
] | null | null | null | xml2img_batch.py | ericshijian/label_ellipse | e4a15b41feb01544e639ade19669b1d38f656b45 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
将xml记录的标记转换为二进制模版图像
'''
import os, sys
import cv2
import numpy as np
import copy
import xml.etree.ElementTree as ET
width, height, x, y, a, b, angle = 0,0,0,0,0,0,0
def generate_mask(xml_path, img_path, save_path, test):
tree = ET.parse(xml_path)
... | 27.681818 | 76 | 0.578818 |
'''
将xml记录的标记转换为二进制模版图像
'''
import os, sys
import cv2
import numpy as np
import copy
import xml.etree.ElementTree as ET
width, height, x, y, a, b, angle = 0,0,0,0,0,0,0
def generate_mask(xml_path, img_path, save_path, test):
tree = ET.parse(xml_path)
for elem in tree.iter():
... | false | true |
08fec388677973d65c8b3a4134b092a97680dcdf | 1,991 | py | Python | notebooks/stimulus_presentation/vep.py | synicalsyntax/eeg-notebooks | 1edcaf24d55eabe076f6ba98645fcc09b3459613 | [
"BSD-3-Clause"
] | 13 | 2018-11-08T13:51:29.000Z | 2021-12-09T23:37:28.000Z | notebooks/stimulus_presentation/vep.py | synicalsyntax/eeg-notebooks | 1edcaf24d55eabe076f6ba98645fcc09b3459613 | [
"BSD-3-Clause"
] | 22 | 2019-01-21T19:30:22.000Z | 2019-03-17T03:35:08.000Z | notebooks/stimulus_presentation/vep.py | synicalsyntax/eeg-notebooks | 1edcaf24d55eabe076f6ba98645fcc09b3459613 | [
"BSD-3-Clause"
] | 6 | 2019-01-24T16:14:18.000Z | 2021-04-06T19:16:06.000Z | import numpy as np
from pandas import DataFrame
from psychopy import visual, core, event
from time import time, strftime, gmtime
from optparse import OptionParser
from pylsl import StreamInfo, StreamOutlet
def present(duration=120):
# create
info = StreamInfo('Markers', 'Markers', 1, 0, 'int32', 'myuidw43536... | 26.197368 | 75 | 0.579608 | import numpy as np
from pandas import DataFrame
from psychopy import visual, core, event
from time import time, strftime, gmtime
from optparse import OptionParser
from pylsl import StreamInfo, StreamOutlet
def present(duration=120):
info = StreamInfo('Markers', 'Markers', 1, 0, 'int32', 'myuidw43536')
... | true | true |
08fec498b11c41f0ab4424372c90d3069bccabc6 | 348 | py | Python | python/first_program.py | rghvat/learning-synopsis | 2f4fefc2d467a8cfb51ea4be4c0c88732787118a | [
"Apache-2.0"
] | null | null | null | python/first_program.py | rghvat/learning-synopsis | 2f4fefc2d467a8cfb51ea4be4c0c88732787118a | [
"Apache-2.0"
] | null | null | null | python/first_program.py | rghvat/learning-synopsis | 2f4fefc2d467a8cfb51ea4be4c0c88732787118a | [
"Apache-2.0"
] | null | null | null | '''
whatever argument are given to module they are seprated meaning
python <modulename> <arg1> <arg2>
0th 1th 2th
argument to sys.argv list
'''
import sys
# argc is argument count
# argv is argument vector
# it is a one dimensional array, and argv is one-dimensional array of strings
prin... | 21.75 | 77 | 0.692529 | import sys
print(sys.argc)
print(sys.argv)
| true | true |
08fec5428db8f7ee38c45266e63a1d7f9fed2398 | 817 | py | Python | profiles_api_project/urls.py | ashishpt1233/profile-rest.api | 52464e79cd2f10bbbe06e46057ac4e10eebe58f0 | [
"MIT"
] | null | null | null | profiles_api_project/urls.py | ashishpt1233/profile-rest.api | 52464e79cd2f10bbbe06e46057ac4e10eebe58f0 | [
"MIT"
] | null | null | null | profiles_api_project/urls.py | ashishpt1233/profile-rest.api | 52464e79cd2f10bbbe06e46057ac4e10eebe58f0 | [
"MIT"
] | null | null | null | """profiles_api_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.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'... | 35.521739 | 77 | 0.711138 | from django.contrib import admin
from django.urls import path,include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('profiles_api.urls'))
]
| true | true |
08fec618057a3ca127cded8e479ed4061a1544e0 | 1,477 | py | Python | microsoft_student_partners/hackcovid19/views.py | smriti-chaudhary/Microsoft-Student-Partners | db8d36149e45ba3b33bf5a431b6e9c2b324cd804 | [
"MIT"
] | 1 | 2021-07-05T12:27:26.000Z | 2021-07-05T12:27:26.000Z | microsoft_student_partners/hackcovid19/views.py | smriti-chaudhary/Microsoft-Student-Partners | db8d36149e45ba3b33bf5a431b6e9c2b324cd804 | [
"MIT"
] | null | null | null | microsoft_student_partners/hackcovid19/views.py | smriti-chaudhary/Microsoft-Student-Partners | db8d36149e45ba3b33bf5a431b6e9c2b324cd804 | [
"MIT"
] | null | null | null | import json
from django.shortcuts import render
from django.views import View
from microsoft_student_partners.github.views import GitHub
class Hackcovid19(View):
template_name = "hackcovid19/index.html"
def get(self, request, *args, **kwargs):
organizers = dict()
with open(
"mic... | 31.425532 | 88 | 0.635748 | import json
from django.shortcuts import render
from django.views import View
from microsoft_student_partners.github.views import GitHub
class Hackcovid19(View):
template_name = "hackcovid19/index.html"
def get(self, request, *args, **kwargs):
organizers = dict()
with open(
"mic... | true | true |
08fec6bc73f4234ae7b01dfa2fef43a705ba9a98 | 11,668 | py | Python | assignment2/classifier.py | SamarthMM/cs769-assignments | bac2ad57c50043608276df8e0f21181ef62696c7 | [
"MIT"
] | null | null | null | assignment2/classifier.py | SamarthMM/cs769-assignments | bac2ad57c50043608276df8e0f21181ef62696c7 | [
"MIT"
] | null | null | null | assignment2/classifier.py | SamarthMM/cs769-assignments | bac2ad57c50043608276df8e0f21181ef62696c7 | [
"MIT"
] | null | null | null | import time, random, numpy as np, argparse, sys, re, os
from types import SimpleNamespace
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from sklearn.metrics import classification_report, f1_score, recall_score, accuracy_score
# change it with respect to the original mod... | 39.023411 | 129 | 0.63987 | import time, random, numpy as np, argparse, sys, re, os
from types import SimpleNamespace
import torch
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from sklearn.metrics import classification_report, f1_score, recall_score, accuracy_score
from tokenizer import BertTokenizer
from ber... | true | true |
08fec77a322953147a3550242d4a44caf7ec8d51 | 2,236 | py | Python | castle.py | jrkong/SuperMario | 27a6ea9dd96594b795ea47be7710491d6b35a5d9 | [
"MIT"
] | null | null | null | castle.py | jrkong/SuperMario | 27a6ea9dd96594b795ea47be7710491d6b35a5d9 | [
"MIT"
] | null | null | null | castle.py | jrkong/SuperMario | 27a6ea9dd96594b795ea47be7710491d6b35a5d9 | [
"MIT"
] | null | null | null | from obstacles import *
castle_shape = [
[ ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','/','\\',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' ],
[ ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','/',' ',' ','\\',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' ],
[ ' ',' ',' ',' ',' ',' ... | 50.818182 | 127 | 0.21288 | from obstacles import *
castle_shape = [
[ ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','/','\\',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' ],
[ ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','/',' ',' ','\\',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' ],
[ ' ',' ',' ',' ',' ',' ... | true | true |
08fec82ba34699d3224f150c780c6b6e32296913 | 976 | py | Python | tests/test_environmentconfig.py | sdil/serfclient-py | 6892fb0a4497d1033bea6f625d57959b818b6964 | [
"MIT"
] | 13 | 2015-06-19T04:41:36.000Z | 2021-09-07T08:30:50.000Z | tests/test_environmentconfig.py | sdil/serfclient-py | 6892fb0a4497d1033bea6f625d57959b818b6964 | [
"MIT"
] | 30 | 2015-01-09T13:04:20.000Z | 2021-04-30T13:37:02.000Z | tests/test_environmentconfig.py | sdil/serfclient-py | 6892fb0a4497d1033bea6f625d57959b818b6964 | [
"MIT"
] | 12 | 2015-01-09T12:44:50.000Z | 2022-01-18T18:23:41.000Z | import mock
from serfclient import EnvironmentConfig
@mock.patch('os.getenv')
def test_defaults(os_getenv):
os_getenv.return_value = None
env = EnvironmentConfig()
assert env.host == 'localhost'
assert env.port == 7373
assert env.auth_key is None
@mock.patch('os.getenv')
def test_serf_rpc_add... | 21.688889 | 42 | 0.677254 | import mock
from serfclient import EnvironmentConfig
@mock.patch('os.getenv')
def test_defaults(os_getenv):
os_getenv.return_value = None
env = EnvironmentConfig()
assert env.host == 'localhost'
assert env.port == 7373
assert env.auth_key is None
@mock.patch('os.getenv')
def test_serf_rpc_add... | true | true |
08fec9c42056b7e63abf22466433f941d0acd523 | 6,235 | py | Python | insert.py | neerajp99/distributed_keyword_based_search | 731c24ff0d87da85fe41fbe11ed6a5ea521030aa | [
"MIT"
] | null | null | null | insert.py | neerajp99/distributed_keyword_based_search | 731c24ff0d87da85fe41fbe11ed6a5ea521030aa | [
"MIT"
] | null | null | null | insert.py | neerajp99/distributed_keyword_based_search | 731c24ff0d87da85fe41fbe11ed6a5ea521030aa | [
"MIT"
] | 1 | 2020-04-16T14:22:00.000Z | 2020-04-16T14:22:00.000Z | # Import Packages
from string import ascii_lowercase
from pathlib import Path
from os import path
import random, string, json, os, unidecode, csv
#Settings
ext = ".txt"
customDirectory = "files"
#Fixed Working Directories
dir_path = os.getcwd()
dir_path += "\ ".strip()+customDirectory
if customDirectory!="":
Path... | 30.563725 | 114 | 0.549479 | from string import ascii_lowercase
from pathlib import Path
from os import path
import random, string, json, os, unidecode, csv
ext = ".txt"
customDirectory = "files"
dir_path = os.getcwd()
dir_path += "\ ".strip()+customDirectory
if customDirectory!="":
Path(customDirectory).mkdir(parents=True, exist_ok=True)
... | true | true |
08fecb256b81b39515bb2f1b063ea8a40751dc7f | 1,762 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_config_cfgmgr_cfg.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_config_cfgmgr_cfg.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_config_cfgmgr_cfg.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-07-22T04:04:44.000Z | 2020-07-22T04:04:44.000Z | """ Cisco_IOS_XR_config_cfgmgr_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR config\-cfgmgr package configuration.
This module contains definitions
for the following management objects\:
cfgmgr\: Cfgmgr configuration
Copyright (c) 2013\-2017 by Cisco Systems, Inc.
All rights reserved... | 27.107692 | 126 | 0.682179 | from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YModelError
from ydk.errors.error_handler import handle_type_error as _handle_type_error
c... | true | true |
08fecdea7ca0627595c56a76884ff94c5c770911 | 283 | py | Python | graph.py | AgusQuintanar/DesignOfAnElectricCircuit | 35dd0b96fc4722d6ec5b3c5173ae5cf2147c83d9 | [
"Unlicense"
] | null | null | null | graph.py | AgusQuintanar/DesignOfAnElectricCircuit | 35dd0b96fc4722d6ec5b3c5173ae5cf2147c83d9 | [
"Unlicense"
] | 2 | 2021-06-08T21:42:41.000Z | 2022-03-12T00:32:47.000Z | graph.py | AgusQuintanar/DesignOfAnElectricCircuit | 35dd0b96fc4722d6ec5b3c5173ae5cf2147c83d9 | [
"Unlicense"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def plot(fun, start, end):
x = np.arange(float(start), float(end), 0.1)
n_fun = np.vectorize(fun)
plt.plot(x, n_fun(x))
plt.show()
if __name__ == "__main__":
fun = lambda x: x**2 - 1
plot(fun, -5, 5) | 18.866667 | 48 | 0.597173 | import numpy as np
import matplotlib.pyplot as plt
def plot(fun, start, end):
x = np.arange(float(start), float(end), 0.1)
n_fun = np.vectorize(fun)
plt.plot(x, n_fun(x))
plt.show()
if __name__ == "__main__":
fun = lambda x: x**2 - 1
plot(fun, -5, 5) | true | true |
08fece3f7a97783d2c70568d4c643e57ea9c7043 | 1,413 | py | Python | runtime/image_classification/models/vgg16/gpus=16_straight/__init__.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | runtime/image_classification/models/vgg16/gpus=16_straight/__init__.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | runtime/image_classification/models/vgg16/gpus=16_straight/__init__.py | vibhatha/pipedream | af6b811f5d01a68e9eb91065e5242fc1a075f279 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from .vgg16 import VGG16Split
from .stage0 import Stage0
from .stage1 import Stage1
from .stage2 import Stage2
from .stage3 import Stage3
from .stage4 import Stage4
from .stage5 import Stage5
from .stage6 import Stage6
from .stage7 im... | 29.4375 | 43 | 0.549186 |
from .vgg16 import VGG16Split
from .stage0 import Stage0
from .stage1 import Stage1
from .stage2 import Stage2
from .stage3 import Stage3
from .stage4 import Stage4
from .stage5 import Stage5
from .stage6 import Stage6
from .stage7 import Stage7
from .stage8 import Stage8
from .stage9 import Stage9
from .... | true | true |
08fece6354d3200b111df8866341163108ec091f | 7,879 | py | Python | test/functional/rpc_users.py | minblock/cheatscoin | 71e234085f789965743c868b6a1bcc13ea879085 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | minblock/cheatscoin | 71e234085f789965743c868b6a1bcc13ea879085 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | minblock/cheatscoin | 71e234085f789965743c868b6a1bcc13ea879085 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 38.062802 | 129 | 0.614799 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
assert_equal,
get_datadir_path,
str_to_b64str,
)
import os
import http.client
import urllib.parse
import subprocess
from random import SystemRandom
import string
import configparser
import sys
class HTTPBasi... | true | true |
08fecea79c5ce4a43ddbe012b8c016f4dde4adaf | 1,390 | py | Python | download.py | Gakamine/asukadon | 5e3041b9ef58e9acb5d2994d1d9349203adefc8a | [
"Unlicense"
] | null | null | null | download.py | Gakamine/asukadon | 5e3041b9ef58e9acb5d2994d1d9349203adefc8a | [
"Unlicense"
] | null | null | null | download.py | Gakamine/asukadon | 5e3041b9ef58e9acb5d2994d1d9349203adefc8a | [
"Unlicense"
] | null | null | null | import requests
import sys
import os.path as op
TAGS = 'souryuu_asuka_langley'
def main():
PAGE = 0
rejected_once = False
while True:
URL = "https://safebooru.donmai.us/posts.json"
PARAMS = { 'tags': TAGS,
'page': PAGE }
r = requests.get(url = URL, para... | 23.965517 | 85 | 0.509353 | import requests
import sys
import os.path as op
TAGS = 'souryuu_asuka_langley'
def main():
PAGE = 0
rejected_once = False
while True:
URL = "https://safebooru.donmai.us/posts.json"
PARAMS = { 'tags': TAGS,
'page': PAGE }
r = requests.get(url = URL, para... | true | true |
08fecfd57e92911e086cd596639f6ab201cc093d | 1,091 | py | Python | src/unitTestGridVisitNeighborhood.cpp.py | jsoeterbroek/pybiosim4 | 751548911abe4adde250e6acaa97cc230df7f2d6 | [
"MIT"
] | null | null | null | src/unitTestGridVisitNeighborhood.cpp.py | jsoeterbroek/pybiosim4 | 751548911abe4adde250e6acaa97cc230df7f2d6 | [
"MIT"
] | null | null | null | src/unitTestGridVisitNeighborhood.cpp.py | jsoeterbroek/pybiosim4 | 751548911abe4adde250e6acaa97cc230df7f2d6 | [
"MIT"
] | null | null | null | # unitTestGridVisitNeighborhood
#include <iostream>
#include "simulator.h"
namespace BS
def unitTestGridVisitNeighborhood(self):
# prints each coord:
printLoc = [&](Coord loc)
std.cout << loc.x << ", " << loc.y << std.endl
std.cout << "Test loc 10, radius 1" << std.endl
visitNeighborhood(Co... | 29.486486 | 90 | 0.621448 |
namespace BS
def unitTestGridVisitNeighborhood(self):
printLoc = [&](Coord loc)
std.cout << loc.x << ", " << loc.y << std.endl
std.cout << "Test loc 10, radius 1" << std.endl
visitNeighborhood(Coord { 10, 10 }, 1.0, printLoc)
std.cout << "\nTest loc 0, radius 1" << std.endl
visitNe... | false | true |
08fed0be44f82f83d3e4fa00b0418ffc16c8eb43 | 1,115 | py | Python | cleaning_scripts/nps_data_fetch.py | michaelpeterswa/HostnameGenerator | 8b48d07335b51c0171a949f61b5fe8c2e90cb197 | [
"MIT"
] | null | null | null | cleaning_scripts/nps_data_fetch.py | michaelpeterswa/HostnameGenerator | 8b48d07335b51c0171a949f61b5fe8c2e90cb197 | [
"MIT"
] | null | null | null | cleaning_scripts/nps_data_fetch.py | michaelpeterswa/HostnameGenerator | 8b48d07335b51c0171a949f61b5fe8c2e90cb197 | [
"MIT"
] | null | null | null | import json
import requests
with open("../data/secrets.json", "r") as secrets:
keys = json.load(secrets)
parks_url = "https://developer.nps.gov/api/v1/parks"
r = requests.get(parks_url, params=keys)
parks_json = r.json()
keys["limit"] = parks_json["total"]
r2 = requests.get(parks_url, params=keys)
parks_json =... | 31.857143 | 100 | 0.606278 | import json
import requests
with open("../data/secrets.json", "r") as secrets:
keys = json.load(secrets)
parks_url = "https://developer.nps.gov/api/v1/parks"
r = requests.get(parks_url, params=keys)
parks_json = r.json()
keys["limit"] = parks_json["total"]
r2 = requests.get(parks_url, params=keys)
parks_json =... | true | true |
08fed14949b2cf9b2e77a80c1125dc180b9a2e9d | 1,900 | py | Python | sbpy/thermal/core.py | dirac-institute/sbpy | 9eb0523610f497ba2d068a071aae05ebfd67ed9d | [
"BSD-3-Clause"
] | 47 | 2018-07-26T04:21:51.000Z | 2022-03-07T16:23:02.000Z | sbpy/thermal/core.py | dirac-institute/sbpy | 9eb0523610f497ba2d068a071aae05ebfd67ed9d | [
"BSD-3-Clause"
] | 253 | 2018-07-24T12:12:57.000Z | 2022-03-13T21:59:52.000Z | sbpy/thermal/core.py | dirac-institute/sbpy | 9eb0523610f497ba2d068a071aae05ebfd67ed9d | [
"BSD-3-Clause"
] | 27 | 2018-07-20T05:25:44.000Z | 2022-03-01T03:29:30.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
sbpy Thermal Module
created on June 27, 2017
"""
__all__ = ['ThermalClass', 'STM', 'FRM', 'NEATM']
class ThermalClass():
def flux(phys, eph, lam):
"""Model flux density for a given wavelength `lam`, or a list/array thereof
Par... | 26.760563 | 102 | 0.578421 |
__all__ = ['ThermalClass', 'STM', 'FRM', 'NEATM']
class ThermalClass():
def flux(phys, eph, lam):
def fit(self, eph):
class STM(ThermalClass):
pass
class FRM(ThermalClass):
pass
class NEATM(ThermalClass):
def __init__(self):
from .. import bib
bib.register('sbpy.thermal.NE... | true | true |
08fed17a5871561cc999432b467a8117b686ae74 | 20,180 | py | Python | tools/generate_serialization_header.py | StableCoder/vulkan-mini-libs-2 | e048f45149816e100d3f4f51306626ebf547b032 | [
"Apache-2.0"
] | 1 | 2022-02-28T20:58:44.000Z | 2022-02-28T20:58:44.000Z | tools/generate_serialization_header.py | StableCoder/vulkan-mini-libs-2 | e048f45149816e100d3f4f51306626ebf547b032 | [
"Apache-2.0"
] | null | null | null | tools/generate_serialization_header.py | StableCoder/vulkan-mini-libs-2 | e048f45149816e100d3f4f51306626ebf547b032 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
import getopt
import xml.etree.ElementTree as ET
def processVendors(outFile, vendors):
outFile.writelines(["\nconstexpr std::array<std::string_view, ", str(
len(vendors)), "> vendors = {{\n"])
for vendor in vendors:
outFile.writelines([' \"', vendor.tag, '\"... | 30.345865 | 101 | 0.607334 |
import sys
import getopt
import xml.etree.ElementTree as ET
def processVendors(outFile, vendors):
outFile.writelines(["\nconstexpr std::array<std::string_view, ", str(
len(vendors)), "> vendors = {{\n"])
for vendor in vendors:
outFile.writelines([' \"', vendor.tag, '\",\n'])
outFile.writ... | true | true |
08fed1cf8110fd6c31bcd5c709f54ad68809126b | 641 | py | Python | ESN/EchoTorch-master/echotorch/transforms/text/__init__.py | RogerFu18/drunken-monkey | 2f8498a83105481d0d189b20407f6e3f658b1053 | [
"MIT"
] | null | null | null | ESN/EchoTorch-master/echotorch/transforms/text/__init__.py | RogerFu18/drunken-monkey | 2f8498a83105481d0d189b20407f6e3f658b1053 | [
"MIT"
] | null | null | null | ESN/EchoTorch-master/echotorch/transforms/text/__init__.py | RogerFu18/drunken-monkey | 2f8498a83105481d0d189b20407f6e3f658b1053 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Imports
from .Character import Character
from .Character2Gram import Character2Gram
from .Character3Gram import Character3Gram
from .Compose import Compose
from .Embedding import Embedding
from .FunctionWord import FunctionWord
from .GensimModel import GensimModel
from .GloveVector import G... | 29.136364 | 137 | 0.776911 |
from .Character import Character
from .Character2Gram import Character2Gram
from .Character3Gram import Character3Gram
from .Compose import Compose
from .Embedding import Embedding
from .FunctionWord import FunctionWord
from .GensimModel import GensimModel
from .GloveVector import GloveVector
from .PartOfSpeech import... | true | true |
08fed2259074381649da6db724955d5411d9fc35 | 827 | py | Python | django_image/tests/backend.py | adamcharnock/django-images | 200a9603e2a4f52fe029c4644ab4ed4af4d6da7f | [
"MIT"
] | null | null | null | django_image/tests/backend.py | adamcharnock/django-images | 200a9603e2a4f52fe029c4644ab4ed4af4d6da7f | [
"MIT"
] | null | null | null | django_image/tests/backend.py | adamcharnock/django-images | 200a9603e2a4f52fe029c4644ab4ed4af4d6da7f | [
"MIT"
] | null | null | null | from django_image.backend import Backend
class DummyBackend(Backend):
def get_url(self, django_file, options):
sorted_options = sorted(options.items())
params = ['{}={}'.format(k, v) for k, v in sorted_options]
url = 'http://imgservice.com/api/{}'.format(django_file.url)
if params... | 33.08 | 68 | 0.588875 | from django_image.backend import Backend
class DummyBackend(Backend):
def get_url(self, django_file, options):
sorted_options = sorted(options.items())
params = ['{}={}'.format(k, v) for k, v in sorted_options]
url = 'http://imgservice.com/api/{}'.format(django_file.url)
if params... | true | true |
08fed2a423e0ca7bfcea85f0d7ec01c6e70af7d6 | 7,510 | py | Python | fit/io/text.py | stpotter16/PySplineFit | 9e0e4d7dd31d4b5fabc7f194e822d1655c047880 | [
"MIT"
] | 2 | 2020-06-21T19:09:34.000Z | 2021-04-18T01:10:37.000Z | fit/io/text.py | stpotter16/PySplineFit | 9e0e4d7dd31d4b5fabc7f194e822d1655c047880 | [
"MIT"
] | 12 | 2019-12-07T22:23:37.000Z | 2020-05-03T21:02:04.000Z | fit/io/text.py | stpotter16/PySplineFit | 9e0e4d7dd31d4b5fabc7f194e822d1655c047880 | [
"MIT"
] | 2 | 2019-04-26T20:29:31.000Z | 2020-08-19T01:19:04.000Z | """
.. module:: fileIO
:platform: Unix, Windows
:synopsis: Functions for handling reading/writing of point cloud and NURBS/B-spline data to and from files
.. moduleauthor:: Sam Potter <spotter1642@gmail.com>
"""
from . import np
from . import spatial
from . import meshio
def write_curve_to_txt(curve_instanc... | 33.377778 | 110 | 0.63755 |
from . import np
from . import spatial
from . import meshio
def write_curve_to_txt(curve_instance, filename):
with open(filename, 'r') as f:
f.write('Degree - p:\n')
f.write('{}\n'.format(curve_instance.degree))
f.write('Number of Knots\n')
f.write('{}\n'.format(l... | true | true |
08fed2cc7a1ba1de9f4c0d9fd1a1a8d7adba2734 | 14,846 | py | Python | sdks/python/apache_beam/runners/interactive/interactive_environment.py | jxub/beam | 8222fcc978a54d98d385c108fb5fcf7615d74829 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/runners/interactive/interactive_environment.py | jxub/beam | 8222fcc978a54d98d385c108fb5fcf7615d74829 | [
"Apache-2.0"
] | 2 | 2021-08-25T16:17:07.000Z | 2022-02-10T04:23:10.000Z | sdks/python/apache_beam/runners/interactive/interactive_environment.py | jxub/beam | 8222fcc978a54d98d385c108fb5fcf7615d74829 | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 41.585434 | 137 | 0.750842 |
from __future__ import absolute_import
import atexit
import importlib
import logging
import sys
import apache_beam as beam
from apache_beam.runners import runner
from apache_beam.utils.interactive_utils import is_in_ipython
from apache_beam.utils.interactive_utils import is_in_notebook
_interactive_beam_env = None... | true | true |
08fed2db624ee43ddfb93ab9127d8410d051254b | 17,676 | py | Python | tools/lib/provision.py | aryan-s1/zulip | 18d78d9a877659eaeb1abf0f6109f8b676babc7f | [
"Apache-2.0"
] | 1 | 2022-01-22T10:03:05.000Z | 2022-01-22T10:03:05.000Z | tools/lib/provision.py | aryan-s1/zulip | 18d78d9a877659eaeb1abf0f6109f8b676babc7f | [
"Apache-2.0"
] | 1 | 2022-02-28T04:01:41.000Z | 2022-02-28T04:01:41.000Z | tools/lib/provision.py | aryan-s1/zulip | 18d78d9a877659eaeb1abf0f6109f8b676babc7f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import argparse
import hashlib
import logging
import os
import platform
import subprocess
import sys
os.environ["PYTHONUNBUFFERED"] = "y"
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from typing import TYPE_CHECKING, List... | 35.352 | 98 | 0.651279 | import argparse
import hashlib
import logging
import os
import platform
import subprocess
import sys
os.environ["PYTHONUNBUFFERED"] = "y"
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from typing import TYPE_CHECKING, List
from scripts.lib.node... | true | true |
08fed3f4c0a8137cb62ba04478193896fe3e1494 | 20,821 | py | Python | tests/test_adjacency_matrix.py | utiasSTARS/GraphIK | c2d05386bf9f9baf8ad146125bfebc3b73fccd14 | [
"MIT"
] | 1 | 2020-11-08T23:26:03.000Z | 2020-11-08T23:26:03.000Z | tests/test_adjacency_matrix.py | utiasSTARS/GraphIK | c2d05386bf9f9baf8ad146125bfebc3b73fccd14 | [
"MIT"
] | null | null | null | tests/test_adjacency_matrix.py | utiasSTARS/GraphIK | c2d05386bf9f9baf8ad146125bfebc3b73fccd14 | [
"MIT"
] | null | null | null | import numpy as np
import networkx as nx
import random
from numpy import pi
from numpy.testing import assert_array_equal
import unittest
from graphik.utils.constants import *
from itertools import combinations, groupby
from graphik.graphs import ProblemGraphPlanar
from graphik.robots import RobotPlanar
from graphik.ut... | 24.323598 | 71 | 0.192786 | import numpy as np
import networkx as nx
import random
from numpy import pi
from numpy.testing import assert_array_equal
import unittest
from graphik.utils.constants import *
from itertools import combinations, groupby
from graphik.graphs import ProblemGraphPlanar
from graphik.robots import RobotPlanar
from graphik.ut... | true | true |
08fed5c3bdd21ebe9a1b3c9d2030187e996e7d1e | 557 | py | Python | investors/migrations/0073_auto_20200906_0938.py | bizeasy17/investtrack | 3840948896573f3906a5df80ea80859a492f4133 | [
"MIT"
] | null | null | null | investors/migrations/0073_auto_20200906_0938.py | bizeasy17/investtrack | 3840948896573f3906a5df80ea80859a492f4133 | [
"MIT"
] | 3 | 2021-07-15T13:23:28.000Z | 2021-12-09T03:32:16.000Z | investors/migrations/0073_auto_20200906_0938.py | bizeasy17/investtrack | 3840948896573f3906a5df80ea80859a492f4133 | [
"MIT"
] | 1 | 2021-08-19T14:42:59.000Z | 2021-08-19T14:42:59.000Z | # Generated by Django 3.0.2 on 2020-09-06 01:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('investors', '0072_auto_20200709_1440'),
]
operations = [
migrations.AlterField(
model_name='tradestrategy',
name='ap... | 29.315789 | 204 | 0.579892 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('investors', '0072_auto_20200709_1440'),
]
operations = [
migrations.AlterField(
model_name='tradestrategy',
name='applied_period',
field=models.CharFiel... | true | true |
08fed5f4423b4288f874d64294e2468efe244a32 | 2,453 | py | Python | owca/containers.py | iwankgb/owca | 8af337e0a16af8810af30a891ddb76f19b8924cc | [
"Apache-2.0"
] | null | null | null | owca/containers.py | iwankgb/owca | 8af337e0a16af8810af30a891ddb76f19b8924cc | [
"Apache-2.0"
] | 2 | 2019-01-23T14:00:22.000Z | 2019-01-31T16:49:18.000Z | owca/containers.py | iwankgb/owca | 8af337e0a16af8810af30a891ddb76f19b8924cc | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 Intel Corporation
#
# 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... | 33.148649 | 99 | 0.698736 |
from typing import List
import logging
from dataclasses import dataclass
from owca.resctrl import ResGroup
from owca.cgroups import Cgroup
from owca.perf import PerfCounters
from owca.metrics import Measurements, MetricName
log = logging.getLogger(__name__)
DEFAULT_EVENTS = (MetricName.INSTRUCTIONS, MetricName.CY... | true | true |
08fed600c0d1922155e7465b9559527aba476079 | 2,513 | py | Python | webapp.py | TheWaWaR/py-marked-diff | 09a3b9b578f37516bec6f93871e25cadf2cccede | [
"MIT"
] | null | null | null | webapp.py | TheWaWaR/py-marked-diff | 09a3b9b578f37516bec6f93871e25cadf2cccede | [
"MIT"
] | null | null | null | webapp.py | TheWaWaR/py-marked-diff | 09a3b9b578f37516bec6f93871e25cadf2cccede | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
#coding: utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import uuid
import json
from flask import (Flask, request, redirect, render_template,
url_for, send_file, abort)
from utils.diff_formatter import parse_diff_blocks, process_files_diff
from utils.... | 29.22093 | 91 | 0.577 |
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import os
import uuid
import json
from flask import (Flask, request, redirect, render_template,
url_for, send_file, abort)
from utils.diff_formatter import parse_diff_blocks, process_files_diff
from utils.gvars import db
from utils.models impo... | false | true |
08fed620cc94c26fcf95e834972356ce1946a594 | 4,559 | py | Python | code/tools/inference.py | lartpang/MINet | 0f4ecf70010af83b432bebc614af90d86a4a6564 | [
"MIT"
] | 202 | 2020-03-27T02:17:07.000Z | 2022-03-30T09:57:45.000Z | code/tools/inference.py | lartpang/MINet | 0f4ecf70010af83b432bebc614af90d86a4a6564 | [
"MIT"
] | 21 | 2020-05-25T18:04:55.000Z | 2021-08-17T01:13:53.000Z | code/tools/inference.py | lartpang/MINet | 0f4ecf70010af83b432bebc614af90d86a4a6564 | [
"MIT"
] | 35 | 2020-04-15T15:12:45.000Z | 2022-03-10T09:24:55.000Z | # -*- coding: utf-8 -*-
# @Time : 2021/6/6
# @Author : Lart Pang
# @GitHub : https://github.com/lartpang
# -*- coding: utf-8 -*-
import os
import sys
from collections import OrderedDict
import torch
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
from torchvision.tra... | 37.991667 | 99 | 0.624918 |
import os
import sys
from collections import OrderedDict
import torch
from PIL import Image
from torch.utils.data import Dataset
from torchvision import transforms
from torchvision.transforms.functional import to_pil_image
from tqdm import tqdm
sys.path.append("../")
import network as network_lib
from config import ... | true | true |
08fed6a28775713fd42a042a9fa541784a3f90f5 | 12,551 | py | Python | eZmaxApi/model/field_e_activesession_weekdaystart.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | eZmaxApi/model/field_e_activesession_weekdaystart.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | eZmaxApi/model/field_e_activesession_weekdaystart.py | ezmaxinc/eZmax-SDK-python | 6794b8001abfb7d9ae18a3b87aba164839b925a0 | [
"MIT"
] | null | null | null | """
eZmax API Definition (Full)
This API expose all the functionnalities for the eZmax and eZsign applications. # noqa: E501
The version of the OpenAPI document: 1.1.7
Contact: support-api@ezmax.ca
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401... | 42.259259 | 169 | 0.549837 |
import re import sys
from eZmaxApi.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
OpenApiMod... | true | true |
08fed701f548c31fad442dacef7293d517b6922f | 5,525 | py | Python | recommender.py | shreyas21295/Scribes-recommender-system | ebf0e0b8ffd4b02d884070efd1cb27f4e205b338 | [
"MIT"
] | null | null | null | recommender.py | shreyas21295/Scribes-recommender-system | ebf0e0b8ffd4b02d884070efd1cb27f4e205b338 | [
"MIT"
] | null | null | null | recommender.py | shreyas21295/Scribes-recommender-system | ebf0e0b8ffd4b02d884070efd1cb27f4e205b338 | [
"MIT"
] | null | null | null | from imports import *
class GET_URLS:
"""
This class encodes methods and variables required to fetch the query results only from educational websites.
We intend to call the methods of this class only once to limit the number of calls to the Google API.
"""
def __init__(self, search_query):
... | 36.589404 | 149 | 0.549502 | from imports import *
class GET_URLS:
def __init__(self, search_query):
super().__init__()
self.search_query = search_query + " lecture notes" self.urls_fetched = []
self.file_name = ''
def fetch_urls(self):
returned_urls = search(self.search_query, num... | true | true |
08fed7d3831947cf81a81144716de06099d63de2 | 12,084 | py | Python | meta-weight-net-class-imbalance.py | jiangwenj02/Meta-weight-net_class-imbalance | 5f7cdb3e0b66336a44695a9b8d240de0e3a3a2c8 | [
"MIT"
] | null | null | null | meta-weight-net-class-imbalance.py | jiangwenj02/Meta-weight-net_class-imbalance | 5f7cdb3e0b66336a44695a9b8d240de0e3a3a2c8 | [
"MIT"
] | null | null | null | meta-weight-net-class-imbalance.py | jiangwenj02/Meta-weight-net_class-imbalance | 5f7cdb3e0b66336a44695a9b8d240de0e3a3a2c8 | [
"MIT"
] | null | null | null | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
# os.environ["CUDA_VISIBLE_DEVICES"]="0"
import time
import argparse
import random
import copy
import torch
import torchvision
import numpy as np
import pandas as pd
import sklearn.metrics as sm
import torch.nn.functional as F
from torch.autograd import Variable
i... | 35.026087 | 106 | 0.642999 | import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
import time
import argparse
import random
import copy
import torch
import torchvision
import numpy as np
import pandas as pd
import sklearn.metrics as sm
import torch.nn.functional as F
from torch.autograd import Variable
import torchvision.transforms as transform... | true | true |
08fed7e0bc328bf80e152d6dc1461c576923fad6 | 589 | py | Python | src/shark/ftp_pwd.py | Wanzaz/Networking | 0ae2090583bbc31c6651fbd4bd5fb9bb21144192 | [
"MIT"
] | 2 | 2021-11-25T20:46:08.000Z | 2021-11-25T20:47:30.000Z | src/shark/ftp_pwd.py | Wanzaz/Networking | 0ae2090583bbc31c6651fbd4bd5fb9bb21144192 | [
"MIT"
] | null | null | null | src/shark/ftp_pwd.py | Wanzaz/Networking | 0ae2090583bbc31c6651fbd4bd5fb9bb21144192 | [
"MIT"
] | null | null | null | #ip ftp username root
#ip ftp password gns3
#copy running-config ftp
#FTP
import pyshark
capture = pyshark.LiveCapture('eth0')
for packet in capture:
if 'FTP' in packet:
try:
output = packet.ftp
if 'USER' in str(output):
print('------------------------------------')... | 24.541667 | 61 | 0.427844 |
import pyshark
capture = pyshark.LiveCapture('eth0')
for packet in capture:
if 'FTP' in packet:
try:
output = packet.ftp
if 'USER' in str(output):
print('------------------------------------')
print('USERNAME: ')
print(output)
... | true | true |
08fed8a3d6f266104e84ddaa13d994b0ec5a6a43 | 1,409 | py | Python | gaffophone/classes.py | Galithil/Gaffophone | d85e3b23b67e8fd1348a3b75a3908eb11db7fa63 | [
"MIT"
] | 1 | 2017-06-15T08:05:52.000Z | 2017-06-15T08:05:52.000Z | gaffophone/classes.py | Galithil/Gaffophone | d85e3b23b67e8fd1348a3b75a3908eb11db7fa63 | [
"MIT"
] | null | null | null | gaffophone/classes.py | Galithil/Gaffophone | d85e3b23b67e8fd1348a3b75a3908eb11db7fa63 | [
"MIT"
] | null | null | null | import praw
import datetime
import codecs
class Gaffophone():
def __init__(self, args):
self.reddit = praw.Reddit('gaffophone')
self.france = self.reddit.subreddit("france")
self.rance = self.reddit.subreddit("rance")
self.test = self.reddit.subreddit("testingground4bots")
... | 40.257143 | 117 | 0.61462 | import praw
import datetime
import codecs
class Gaffophone():
def __init__(self, args):
self.reddit = praw.Reddit('gaffophone')
self.france = self.reddit.subreddit("france")
self.rance = self.reddit.subreddit("rance")
self.test = self.reddit.subreddit("testingground4bots")
... | true | true |
08feda21923500df6762d02b979793fac9bba452 | 104,266 | py | Python | pyang/statements.py | krvinay123/test | e571be864cc1ab8c1a642431dc82d24017cbcc54 | [
"0BSD"
] | null | null | null | pyang/statements.py | krvinay123/test | e571be864cc1ab8c1a642431dc82d24017cbcc54 | [
"0BSD"
] | null | null | null | pyang/statements.py | krvinay123/test | e571be864cc1ab8c1a642431dc82d24017cbcc54 | [
"0BSD"
] | null | null | null | import copy
import re
from . import util
from .util import attrsearch, keysearch, prefix_to_module, \
prefix_to_modulename_and_revision
from .error import err_add
from . import types
from . import syntax
from . import grammar
from . import xpath
### Exceptions
class NotFound(Exception):
"""used when a refere... | 38.992521 | 80 | 0.560183 | import copy
import re
from . import util
from .util import attrsearch, keysearch, prefix_to_module, \
prefix_to_modulename_and_revision
from .error import err_add
from . import types
from . import syntax
from . import grammar
from . import xpath
class NotFound(Exception):
pass
class Abort(Exception):
pa... | true | true |
08fedbfd0bfd5034344b78da9766f4f645c32edb | 571 | py | Python | monty_hall_problem.py | luxorv/statistics | f9b9938b1f6aec475cd942871128e16f6ebccc1a | [
"MIT"
] | null | null | null | monty_hall_problem.py | luxorv/statistics | f9b9938b1f6aec475cd942871128e16f6ebccc1a | [
"MIT"
] | null | null | null | monty_hall_problem.py | luxorv/statistics | f9b9938b1f6aec475cd942871128e16f6ebccc1a | [
"MIT"
] | null | null | null | from random import randint
N = 1000
def simulate(N):
K = 0
car_choice = randint(1, 3)
for i in range(N):
my_choice = randint(1, 3)
if my_choice == car_choice:
monte_choice = randint(1, 3)
while monte_choice == car_choice:
monte_choice = randint(1... | 19.689655 | 56 | 0.544658 | from random import randint
N = 1000
def simulate(N):
K = 0
car_choice = randint(1, 3)
for i in range(N):
my_choice = randint(1, 3)
if my_choice == car_choice:
monte_choice = randint(1, 3)
while monte_choice == car_choice:
monte_choice = randint(1... | true | true |
08fedfe95ad8366e31849f08be191ae045fb8469 | 1,089 | py | Python | google-cloud-container_analysis-v1/synth.py | teamapp/google-cloud-ruby | 4687c69c70782661a9be1f418693780fd95ddff1 | [
"Apache-2.0"
] | null | null | null | google-cloud-container_analysis-v1/synth.py | teamapp/google-cloud-ruby | 4687c69c70782661a9be1f418693780fd95ddff1 | [
"Apache-2.0"
] | null | null | null | google-cloud-container_analysis-v1/synth.py | teamapp/google-cloud-ruby | 4687c69c70782661a9be1f418693780fd95ddff1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# 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, s... | 34.03125 | 106 | 0.77135 |
import synthtool as s
import synthtool.gcp as gcp
import synthtool.languages.ruby as ruby
import logging
logging.basicConfig(level=logging.DEBUG)
gapic = gcp.GAPICBazel()
library = gapic.ruby_library(
"containeranalysis", "v1",
proto_path="google/devtools/containeranalysis/v1",
bazel_target="//google/de... | true | true |
08fee0b498f178bf3b91783db776e47fd60c0973 | 11,383 | bzl | Python | lang/image.bzl | dprotaso/rules_docker | 6d9fdf2ca948ba4cfe3da778bb5afae71a3cf8dd | [
"Apache-2.0"
] | null | null | null | lang/image.bzl | dprotaso/rules_docker | 6d9fdf2ca948ba4cfe3da778bb5afae71a3cf8dd | [
"Apache-2.0"
] | null | null | null | lang/image.bzl | dprotaso/rules_docker | 6d9fdf2ca948ba4cfe3da778bb5afae71a3cf8dd | [
"Apache-2.0"
] | null | null | null | # 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 a... | 38.456081 | 114 | 0.673285 |
load(
"//container:container.bzl",
_container = "container",
)
load(
"//container:layer_tools.bzl",
_get_layers = "get_from_target",
)
load("//container:providers.bzl", "FilterAspectInfo", "FilterLayerInfo")
def _binary_name(ctx):
return "/".join([
ctx.attr.directory,
ctx.a... | true | true |
08fee2393bb946e28fe7a59d61fb7e74f0ccaaa5 | 11,439 | py | Python | portScanner.py | farkoo/NMAP-Port-Scanner | ec3a8bb4b989e154aa03920bed53b484eced0be6 | [
"MIT"
] | null | null | null | portScanner.py | farkoo/NMAP-Port-Scanner | ec3a8bb4b989e154aa03920bed53b484eced0be6 | [
"MIT"
] | null | null | null | portScanner.py | farkoo/NMAP-Port-Scanner | ec3a8bb4b989e154aa03920bed53b484eced0be6 | [
"MIT"
] | null | null | null | import argparse
import socket
import sys
from struct import *
import binascii
import portList
import time
sstarget = ""
target = 0
begin_port = 0
end_port = 0
delay = 0
mode = 0
class Packet:
def __init__(self, src_ip, dest_ip, dest_port, _mode):
# IP segment
self.version =... | 36.199367 | 207 | 0.511146 | import argparse
import socket
import sys
from struct import *
import binascii
import portList
import time
sstarget = ""
target = 0
begin_port = 0
end_port = 0
delay = 0
mode = 0
class Packet:
def __init__(self, src_ip, dest_ip, dest_port, _mode):
self.version = 0x4
... | true | true |
08fee50181d909348f92fcc9d648bd3207382cb6 | 205 | py | Python | jp.atcoder/abc213/abc213_b/24854487.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc213/abc213_b/24854487.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc213/abc213_b/24854487.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
import typing
import numpy as np
def main():
n = int(input())
a = np.array(
sys.stdin.readline()
.split(),
dtype=np.int64,
)
i = np.argsort(a)
print(i[-2] + 1)
main()
| 10.789474 | 24 | 0.565854 | import sys
import typing
import numpy as np
def main():
n = int(input())
a = np.array(
sys.stdin.readline()
.split(),
dtype=np.int64,
)
i = np.argsort(a)
print(i[-2] + 1)
main()
| true | true |
08fee5074d3ec1285be8edd8db9dcc0cf2a021db | 8,154 | py | Python | contrib/devtools/update-translations.py | keepscoin/keepscoin | b0bc99352ef4c1bc0a873a4d7ba46044ea9a88f5 | [
"MIT"
] | 4 | 2020-09-03T09:17:14.000Z | 2020-11-13T04:41:46.000Z | contrib/devtools/update-translations.py | keepscoin/keepscoin | b0bc99352ef4c1bc0a873a4d7ba46044ea9a88f5 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | keepscoin/keepscoin | b0bc99352ef4c1bc0a873a4d7ba46044ea9a88f5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the follo... | 38.64455 | 124 | 0.634045 | from __future__ import division, print_function
import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'keepscoin_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
print('N... | true | true |
08fee5df6d43bb80284a92b04bcc18e2811bda85 | 5,629 | py | Python | ampel/cli/AbsStockCommand.py | AmpelProject/Ampel-core | dcbfbe38ba400b7f8e44e641b90217ca1bed4f8f | [
"BSD-3-Clause"
] | 5 | 2021-04-15T07:43:26.000Z | 2022-03-04T09:25:09.000Z | ampel/cli/AbsStockCommand.py | AmpelProject/Ampel-core | dcbfbe38ba400b7f8e44e641b90217ca1bed4f8f | [
"BSD-3-Clause"
] | 67 | 2021-02-23T21:43:20.000Z | 2021-12-15T23:28:32.000Z | ampel/cli/AbsStockCommand.py | AmpelProject/Ampel-core | dcbfbe38ba400b7f8e44e641b90217ca1bed4f8f | [
"BSD-3-Clause"
] | 1 | 2021-04-26T07:52:19.000Z | 2021-04-26T07:52:19.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File : Ampel-core/ampel/cli/AbsStockCommand.py
# License : BSD-3-Clause
# Author : vb <vbrinnel@physik.hu-berlin.de>
# Date : 25.03.2021
# Last Modified Date: 25.03.2021
# Last Modified By : vb <vbrinnel@physik.hu-berlin.de>... | 39.921986 | 109 | 0.688399 |
from typing import Dict, Any, Optional, Union, Literal
from ampel.cli.ArgParserBuilder import ArgParserBuilder
from ampel.cli.MaybeIntAction import MaybeIntAction
from ampel.cli.LoadJSONAction import LoadJSONAction
from ampel.cli.AbsCoreCommand import AbsCoreCommand
from ampel.mongo.utils import maybe_match_array
from... | true | true |
08fee663966b526b527feec907fc7a8773adee15 | 1,939 | py | Python | molecool/visualize.py | jchen0506/molecool | dc931c165c34edeae4a38e67976138c017c5857c | [
"BSD-3-Clause"
] | null | null | null | molecool/visualize.py | jchen0506/molecool | dc931c165c34edeae4a38e67976138c017c5857c | [
"BSD-3-Clause"
] | null | null | null | molecool/visualize.py | jchen0506/molecool | dc931c165c34edeae4a38e67976138c017c5857c | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D # noqat: F401
from .atom_data import (
atom_colors,
) # .atome_data relative import, . check the same folder
def bond_histogram(bond_list, save_location=None, dpi=300, graph_min=0, graph_max=2):
# Draw a histogram o... | 24.544304 | 98 | 0.611655 | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from .atom_data import (
atom_colors,
)
def bond_histogram(bond_list, save_location=None, dpi=300, graph_min=0, graph_max=2):
lengths = []
for atoms, bond_length in bond_list.items():
lengths.append... | true | true |
08fee6ebc7fa910840bb75e3fb2280b7d1affb2d | 3,288 | py | Python | src/dataset.py | iwonasob/DCASE_rare | 3f9f55a1958602ac61e2e5ab02866d7215a5d131 | [
"MIT"
] | 2 | 2019-05-23T08:24:13.000Z | 2019-08-19T08:53:31.000Z | src/dataset.py | iwonasob/DCASE_rare | 3f9f55a1958602ac61e2e5ab02866d7215a5d131 | [
"MIT"
] | null | null | null | src/dataset.py | iwonasob/DCASE_rare | 3f9f55a1958602ac61e2e5ab02866d7215a5d131 | [
"MIT"
] | null | null | null | '''
Download, extract and partition the datasets
'''
import config as cfg
import os
import sys
import requests
import zipfile
from clint.textui import progress
import numpy as np
np.random.seed(1515)
import pandas as pd
class DatasetCreator:
def __init__(self,
dataset_name):
... | 33.55102 | 119 | 0.546837 | import config as cfg
import os
import sys
import requests
import zipfile
from clint.textui import progress
import numpy as np
np.random.seed(1515)
import pandas as pd
class DatasetCreator:
def __init__(self,
dataset_name):
self.dataset_name = dataset_name
s... | true | true |
08fee6f7f31362a4517636fe1109dba5a8a401da | 51 | py | Python | SOA/paf-cython/Extension/test.py | awaiswill/present | 1cfbc8d1f31ade6c21e3ed1d0685c31b3a772485 | [
"Apache-2.0"
] | 120 | 2019-02-15T18:46:59.000Z | 2022-03-30T14:49:05.000Z | SOA/paf-cython/Extension/test.py | smartquark/present | 21a31ab2f38474a68e5560a3330aa42d0847c9b3 | [
"Apache-2.0"
] | 9 | 2020-04-20T14:20:00.000Z | 2022-03-12T00:23:35.000Z | SOA/paf-cython/Extension/test.py | awaiswill/present | 1cfbc8d1f31ade6c21e3ed1d0685c31b3a772485 | [
"Apache-2.0"
] | 116 | 2017-01-05T20:05:32.000Z | 2022-03-19T23:04:00.000Z | import Calculate as c
print(c.sdev([1,2,3,4,5]))
| 10.2 | 26 | 0.647059 | import Calculate as c
print(c.sdev([1,2,3,4,5]))
| true | true |
08fee92c431e0e14c769fdd536ee1b939cb3e189 | 562 | py | Python | inventories/migrations/0076_auto_20200606_0520.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | null | null | null | inventories/migrations/0076_auto_20200606_0520.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | 7 | 2021-03-19T03:09:53.000Z | 2022-01-13T02:48:44.000Z | inventories/migrations/0076_auto_20200606_0520.py | amado-developer/ReadHub-RestfulAPI | 8d8b445c4a84810d52bbf78a2593e0b48351590c | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-06 05:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('digital_books', '0008_digital_book_rating'),
('inventories', '0075_auto_20200606_0314'),
]
operations = [
... | 26.761905 | 125 | 0.660142 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('digital_books', '0008_digital_book_rating'),
('inventories', '0075_auto_20200606_0314'),
]
operations = [
migrations.AlterField(
model_... | true | true |
08feeb0b968e0eae86c77450a813dda538da3a5d | 448 | py | Python | setup.py | vishnubob/rockit | cbf10616b0d689cbe364fb4190f6b1e75330298b | [
"MIT"
] | 26 | 2015-01-01T19:53:20.000Z | 2022-01-22T23:34:31.000Z | setup.py | vishnubob/rockit | cbf10616b0d689cbe364fb4190f6b1e75330298b | [
"MIT"
] | 1 | 2015-02-16T21:43:19.000Z | 2015-02-17T21:05:00.000Z | setup.py | vishnubob/rockit | cbf10616b0d689cbe364fb4190f6b1e75330298b | [
"MIT"
] | 4 | 2016-12-19T19:03:37.000Z | 2020-11-09T02:51:33.000Z | #!/usr/bin/env python
from distutils.core import setup, Extension
rockit = {
"name": "rockit",
"description": "model rocket generator",
"author":"Giles Hall",
"packages": ["rockit", "rockit.solid"],
"package_dir": {"rockit": "src/rockit"},
"package_data": {'rockit': ['templates/*.json']},
... | 24.888889 | 59 | 0.613839 |
from distutils.core import setup, Extension
rockit = {
"name": "rockit",
"description": "model rocket generator",
"author":"Giles Hall",
"packages": ["rockit", "rockit.solid"],
"package_dir": {"rockit": "src/rockit"},
"package_data": {'rockit': ['templates/*.json']},
"scripts":["scripts/ca... | true | true |
08feed23a38c432b8f3ad7cafb764ffecc4efe51 | 3,896 | py | Python | ddpg.py | Luoyadan/ddpg_power | 9f1bcd0c3874229933070b47f96e554738a72a77 | [
"MIT"
] | null | null | null | ddpg.py | Luoyadan/ddpg_power | 9f1bcd0c3874229933070b47f96e554738a72a77 | [
"MIT"
] | null | null | null | ddpg.py | Luoyadan/ddpg_power | 9f1bcd0c3874229933070b47f96e554738a72a77 | [
"MIT"
] | null | null | null | # -----------------------------------
# Deep Deterministic Policy Gradient
# Author: Flood Sung
# Date: 2016.5.4
# -----------------------------------
import tensorflow as tf
import numpy as np
from ou_noise import OUNoise
from critic_network import CriticNetwork
from actor_network_bn import ActorNetwork
from replay_... | 34.175439 | 96 | 0.673255 |
import tensorflow as tf
import numpy as np
from ou_noise import OUNoise
from critic_network import CriticNetwork
from actor_network_bn import ActorNetwork
from replay_buffer import ReplayBuffer
REPLAY_BUFFER_SIZE = 1000000
REPLAY_START_SIZE = 10000
BATCH_SIZE = 64
GAMMA = 0.99
class DDPG:
def __init__(self, e... | true | true |
08feefbe591b71e6f48a791cc1f1b7c2c128bf24 | 493 | py | Python | examples/python/union_find_aoj.test.py | 12tqian/verification-helper-1 | bfdb9a357b451a1385e5327417b3d17168ad2d51 | [
"MIT"
] | 88 | 2020-05-03T03:29:01.000Z | 2022-03-01T09:12:44.000Z | examples/python/union_find_aoj.test.py | 12tqian/verification-helper-1 | bfdb9a357b451a1385e5327417b3d17168ad2d51 | [
"MIT"
] | 158 | 2019-11-25T16:48:06.000Z | 2020-05-02T14:39:56.000Z | examples/python/union_find_aoj.test.py | 12tqian/verification-helper-1 | bfdb9a357b451a1385e5327417b3d17168ad2d51 | [
"MIT"
] | 40 | 2020-05-05T09:26:03.000Z | 2022-03-13T16:14:41.000Z | # verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_1_A
import sys
input = sys.stdin.buffer.readline
from examples.python.union_find import UnionFindTree
def main() -> None:
N, Q = map(int, input().split())
uft = UnionFindTree(N)
for _ in range(Q):
t, u, ... | 23.47619 | 97 | 0.604462 | import sys
input = sys.stdin.buffer.readline
from examples.python.union_find import UnionFindTree
def main() -> None:
N, Q = map(int, input().split())
uft = UnionFindTree(N)
for _ in range(Q):
t, u, v = map(int, input().split())
if t == 0:
uft.unite(u, v)
else:
... | true | true |
08fef1299d74e0da784e683ae124f48119fc2175 | 4,168 | py | Python | packages/pytiger2c/ast/divideoperatornode.py | yasserglez/pytiger2c | 35c44d14775bf69ed6689b708b98d6d1ca533ba0 | [
"MIT"
] | 2 | 2015-11-16T11:50:24.000Z | 2017-09-27T23:18:16.000Z | packages/pytiger2c/ast/divideoperatornode.py | yasserglez/pytiger2c | 35c44d14775bf69ed6689b708b98d6d1ca533ba0 | [
"MIT"
] | null | null | null | packages/pytiger2c/ast/divideoperatornode.py | yasserglez/pytiger2c | 35c44d14775bf69ed6689b708b98d6d1ca533ba0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Clase C{DivideOperatorNode} del árbol de sintáxis abstracta.
"""
from pytiger2c.ast.arithmeticoperatornode import ArithmeticOperatorNode
from pytiger2c.types.integertype import IntegerType
class DivideOperatorNode(ArithmeticOperatorNode):
"""
Clase C{DivideOperatorNode} del árbol... | 42.969072 | 108 | 0.629559 |
from pytiger2c.ast.arithmeticoperatornode import ArithmeticOperatorNode
from pytiger2c.types.integertype import IntegerType
class DivideOperatorNode(ArithmeticOperatorNode):
def __init__(self, left, right):
super(DivideOperatorNode, self).__init__(left, right)
self._operator = '/'
... | true | true |
08fef13d8e5eddf906a2d7faae309dee3549e825 | 7,341 | py | Python | auditbeat/tests/system/test_file_integrity.py | tetianakravchenko/beats | 6aec024e0ab8239791be20885d6d3c58697d18cd | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-01-17T17:31:41.000Z | 2022-01-17T17:31:41.000Z | auditbeat/tests/system/test_file_integrity.py | tetianakravchenko/beats | 6aec024e0ab8239791be20885d6d3c58697d18cd | [
"ECL-2.0",
"Apache-2.0"
] | 26 | 2021-11-04T11:17:36.000Z | 2022-02-16T11:55:30.000Z | auditbeat/tests/system/test_file_integrity.py | tetianakravchenko/beats | 6aec024e0ab8239791be20885d6d3c58697d18cd | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2019-08-05T07:42:54.000Z | 2020-09-02T14:23:19.000Z | import time
import unittest
import platform
from auditbeat import *
# Escapes a path to match what's printed in the logs
def escape_path(path):
return path.replace('\\', '\\\\')
def has_file(objs, path, sha1hash):
found = False
for obj in objs:
if 'file.path' in obj and 'file.hash.sha1' in obj \... | 36.889447 | 121 | 0.569405 | import time
import unittest
import platform
from auditbeat import *
def escape_path(path):
return path.replace('\\', '\\\\')
def has_file(objs, path, sha1hash):
found = False
for obj in objs:
if 'file.path' in obj and 'file.hash.sha1' in obj \
and obj['file.path'].lower() == path... | true | true |
08fef156a9bd01e52e2a37ea55bc94a901ab7f51 | 6,211 | py | Python | src/data/gedi_query_tools.py | Croydon-Brixton/gedi-biomass-mapping | bd6021a8515597d5ce14221afa47758803b4864a | [
"MIT"
] | null | null | null | src/data/gedi_query_tools.py | Croydon-Brixton/gedi-biomass-mapping | bd6021a8515597d5ce14221afa47758803b4864a | [
"MIT"
] | null | null | null | src/data/gedi_query_tools.py | Croydon-Brixton/gedi-biomass-mapping | bd6021a8515597d5ce14221afa47758803b4864a | [
"MIT"
] | null | null | null | """Module to conveniently query GEDI v002 data (primarily L1B and L2A) locally"""
import pathlib
from dataclasses import dataclass
import folium
import folium.features
import folium.plugins
import geopandas as gpd
import pandas as pd
import shapely
import shapely.geometry
from src.constants import GEDI_L2A_PATH
@da... | 30.150485 | 88 | 0.688617 | import pathlib
from dataclasses import dataclass
import folium
import folium.features
import folium.plugins
import geopandas as gpd
import pandas as pd
import shapely
import shapely.geometry
from src.constants import GEDI_L2A_PATH
@dataclass
class QueryParameters:
base_url: str
provider: str
product: st... | true | true |
08fef38a58138e3be0f74cba3e547344d5a0681f | 24 | py | Python | tst/__init__.py | djjh/reinforcement-learning-labs | 22706dab9e7f16e364ee4ed79c0bd67a343e5b08 | [
"MIT"
] | 1 | 2019-10-06T11:45:52.000Z | 2019-10-06T11:45:52.000Z | tst/__init__.py | djjh/reinforcement-learning-labs | 22706dab9e7f16e364ee4ed79c0bd67a343e5b08 | [
"MIT"
] | null | null | null | tst/__init__.py | djjh/reinforcement-learning-labs | 22706dab9e7f16e364ee4ed79c0bd67a343e5b08 | [
"MIT"
] | null | null | null | from . import utilities
| 12 | 23 | 0.791667 | from . import utilities
| true | true |
08fef42acd598beb929ce6b3717b9f0a02c07e21 | 1,978 | py | Python | move_jismeshcode/sub.py | igtm/move_jismeshcode | ce8fd5c1a339861d92e8a60089ff6a0e1f4c7cb2 | [
"MIT"
] | null | null | null | move_jismeshcode/sub.py | igtm/move_jismeshcode | ce8fd5c1a339861d92e8a60089ff6a0e1f4c7cb2 | [
"MIT"
] | null | null | null | move_jismeshcode/sub.py | igtm/move_jismeshcode | ce8fd5c1a339861d92e8a60089ff6a0e1f4c7cb2 | [
"MIT"
] | null | null | null | from typing import Tuple, Union, List
from move_jismeshcode.move import _listDigit, _move
def sub(minuend: Union[int, str], subtrahend: Union[int, str]) -> Tuple[int, int]:
if len(str(minuend)) != len(str(subtrahend)):
raise ValueError('length of minuend and subtrahend must be equal')
x, y = 0, 0
... | 25.358974 | 82 | 0.555612 | from typing import Tuple, Union, List
from move_jismeshcode.move import _listDigit, _move
def sub(minuend: Union[int, str], subtrahend: Union[int, str]) -> Tuple[int, int]:
if len(str(minuend)) != len(str(subtrahend)):
raise ValueError('length of minuend and subtrahend must be equal')
x, y = 0, 0
... | true | true |
08fef46d7bef154151f725e8fa41400a7324b3e1 | 1,483 | py | Python | app/pywiki/models.py | vvuri/flask_pipeline | d3f283b8a6a6239e56d85e67dbe3edce55bcb980 | [
"MIT"
] | null | null | null | app/pywiki/models.py | vvuri/flask_pipeline | d3f283b8a6a6239e56d85e67dbe3edce55bcb980 | [
"MIT"
] | null | null | null | app/pywiki/models.py | vvuri/flask_pipeline | d3f283b8a6a6239e56d85e67dbe3edce55bcb980 | [
"MIT"
] | null | null | null | from sqlalchemy import Boolean, Column, Integer, String, Text, DateTime, ForeignKey, MetaData
# from sqlalchemy.orm import relationship
from database import Base
import re
# from sqlalchemy.orm import declarative_base
# Base = declarative_base()
# https://alembic.sqlalchemy.org/en/latest/naming.html
convention = {
... | 26.482143 | 93 | 0.66824 | from sqlalchemy import Boolean, Column, Integer, String, Text, DateTime, ForeignKey, MetaData
from database import Base
import re
convention = {
"ix": "ix_%(column_0_label)s",
"uq": "uq_%(table_name)s_%(column_0_name)s",
"ck": "ck_%(table_name)s_%(constraint_name)s",
"fk": "fk_%(table_name)s_%(column_0_name)... | true | true |
08fef4b5e3ea16a7cab8fd9910d7e8718feb79ff | 736 | py | Python | lambdas/redirect-2cognito/app.py | RustamGimadiev/terraform-aws-wireguard | 83445f60928d1d63089805f220d6b8587f7999c6 | [
"Apache-2.0"
] | null | null | null | lambdas/redirect-2cognito/app.py | RustamGimadiev/terraform-aws-wireguard | 83445f60928d1d63089805f220d6b8587f7999c6 | [
"Apache-2.0"
] | null | null | null | lambdas/redirect-2cognito/app.py | RustamGimadiev/terraform-aws-wireguard | 83445f60928d1d63089805f220d6b8587f7999c6 | [
"Apache-2.0"
] | null | null | null | import os
import boto3
import json
import logging
client_id = os.getenv('COGNITO_USER_POOL_CLIENT_ID')
cognito_pool_name = os.getenv('COGNITO_POOL_NAME')
cognito_region = os.getenv('COGNITO_REGION')
def handler(event, context):
redirect_url = "https://" + cognito_pool_name + ".auth." + cognito_region + \
... | 33.454545 | 125 | 0.619565 | import os
import boto3
import json
import logging
client_id = os.getenv('COGNITO_USER_POOL_CLIENT_ID')
cognito_pool_name = os.getenv('COGNITO_POOL_NAME')
cognito_region = os.getenv('COGNITO_REGION')
def handler(event, context):
redirect_url = "https://" + cognito_pool_name + ".auth." + cognito_region + \
... | true | true |
08fef5af3a80543321a3831df8e8892a35946239 | 9,663 | py | Python | contrib/bitrpc/bitrpc.py | epiccoinio/Epic | f9988e110428503888338c343f56a0964cb52bf1 | [
"MIT"
] | 2 | 2018-12-09T07:45:25.000Z | 2019-08-02T18:51:36.000Z | contrib/bitrpc/bitrpc.py | EpicCrypto/Epic | d78cc7380850aba19ab79e6f7a5d4b1ad4abb875 | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | EpicCrypto/Epic | d78cc7380850aba19ab79e6f7a5d4b1ad4abb875 | [
"MIT"
] | 3 | 2018-09-28T13:07:19.000Z | 2019-05-28T03:30:11.000Z | from jsonrpc import ServiceProxy
import sys
import string
import getpass
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:1256")
e... | 28.588757 | 101 | 0.573424 | from jsonrpc import ServiceProxy
import sys
import string
import getpass
rpcuser = ""
rpcpass = ""
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:1256")
else:
access = ServiceProxy("http://"+rpcuser+":"+rpcpass+"@127.0.0.1:1256")
cmd = sys.argv[1].lower()
if cmd == "backupwallet":
try:
... | false | true |
08fef6eb580f22d75e6bfff7705476416a9c6ec0 | 6,585 | py | Python | src/urh/dev/native/HackRF.py | awesome-archive/urh | c8c3aabc9d637ca660d8c72c3d8372055e0f3ec7 | [
"Apache-2.0"
] | null | null | null | src/urh/dev/native/HackRF.py | awesome-archive/urh | c8c3aabc9d637ca660d8c72c3d8372055e0f3ec7 | [
"Apache-2.0"
] | null | null | null | src/urh/dev/native/HackRF.py | awesome-archive/urh | c8c3aabc9d637ca660d8c72c3d8372055e0f3ec7 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import time
from urh.dev.native.Device import Device
from urh.dev.native.lib import hackrf
from urh.util.Logger import logger
class HackRF(Device):
BYTES_PER_SAMPLE = 2 # HackRF device produces 8 bit unsigned IQ data
def __init__(self, bw, freq, gain, srate, is_ringbuffer=False):
... | 34.119171 | 122 | 0.588459 | import numpy as np
import time
from urh.dev.native.Device import Device
from urh.dev.native.lib import hackrf
from urh.util.Logger import logger
class HackRF(Device):
BYTES_PER_SAMPLE = 2
def __init__(self, bw, freq, gain, srate, is_ringbuffer=False):
super().__init__(bw, freq, gain, srate, is_ring... | true | true |
08fef7016670fa9575d2ff7c6d9c0234e88a69ea | 2,900 | py | Python | deckhand/engine/schema/v1_0/validation_policy_schema.py | att-comdev/test-submit | 5961c0a91d348d531c1cbfc729e6d9b40cb28df7 | [
"Apache-2.0"
] | null | null | null | deckhand/engine/schema/v1_0/validation_policy_schema.py | att-comdev/test-submit | 5961c0a91d348d531c1cbfc729e6d9b40cb28df7 | [
"Apache-2.0"
] | null | null | null | deckhand/engine/schema/v1_0/validation_policy_schema.py | att-comdev/test-submit | 5961c0a91d348d531c1cbfc729e6d9b40cb28df7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 AT&T Intellectual Property. All other 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... | 35.802469 | 79 | 0.516552 |
schema = {
'type': 'object',
'properties': {
'schema': {
'type': 'string',
'pattern': '^deckhand/ValidationPolicy/v\d+(.0)?$'
},
'metadata': {
'type': 'object',
'properties': {
'schema': {
'type': 'strin... | true | true |
08fef7548a2e13677c5d9e0ad9dca9ba97278532 | 21,454 | py | Python | hbmqtt/client.py | girtsf/hbmqtt | af8238e6bf72ba1193eaec0e3b74f964bf602efb | [
"MIT"
] | null | null | null | hbmqtt/client.py | girtsf/hbmqtt | af8238e6bf72ba1193eaec0e3b74f964bf602efb | [
"MIT"
] | null | null | null | hbmqtt/client.py | girtsf/hbmqtt | af8238e6bf72ba1193eaec0e3b74f964bf602efb | [
"MIT"
] | null | null | null | # Copyright (c) 2015 Nicolas JOUANIN
#
# See the file license.txt for copying permission.
import asyncio
import logging
import ssl
from urllib.parse import urlparse, urlunparse
from functools import wraps
from hbmqtt.utils import not_in_dict_or_none
from hbmqtt.session import Session
from hbmqtt.mqtt.connack import C... | 41.416988 | 315 | 0.620351 |
import asyncio
import logging
import ssl
from urllib.parse import urlparse, urlunparse
from functools import wraps
from hbmqtt.utils import not_in_dict_or_none
from hbmqtt.session import Session
from hbmqtt.mqtt.connack import CONNECTION_ACCEPTED
from hbmqtt.mqtt.protocol.client_handler import ClientProtocolHandler
f... | false | true |
08fef7d83ed3e3cbff230597dbd73889377a1f93 | 1,628 | py | Python | ros2msg/ros2msg/verb/show.py | sagniknitr/ros2cli | d682c3e74e59ebaa1ccd283400475daa3fd6a673 | [
"Apache-2.0"
] | null | null | null | ros2msg/ros2msg/verb/show.py | sagniknitr/ros2cli | d682c3e74e59ebaa1ccd283400475daa3fd6a673 | [
"Apache-2.0"
] | null | null | null | ros2msg/ros2msg/verb/show.py | sagniknitr/ros2cli | d682c3e74e59ebaa1ccd283400475daa3fd6a673 | [
"Apache-2.0"
] | 1 | 2019-01-02T18:57:16.000Z | 2019-01-02T18:57:16.000Z | # Copyright 2017 Open Source Robotics Foundation, 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... | 37 | 74 | 0.677518 |
from ros2msg.api import get_message_path
from ros2msg.api import message_type_completer
from ros2msg.verb import VerbExtension
class ShowVerb(VerbExtension):
def add_arguments(self, parser, cli_name):
arg = parser.add_argument(
'message_type',
help="Type of the ROS message (e.g. ... | true | true |
08fef8355a15878b5fce98c8cc0754b10ab64d05 | 4,941 | py | Python | pyLMS7002Soapy/LMS7002_AFE.py | UCI-CubeSat/pyLMS7002Soapy | 4f828eb9282c302dc6b187d91df5e77c8a6f2d61 | [
"Apache-2.0"
] | 53 | 2018-04-27T12:12:20.000Z | 2022-02-23T00:06:10.000Z | pyLMS7002Soapy/LMS7002_AFE.py | UCI-CubeSat/pyLMS7002Soapy | 4f828eb9282c302dc6b187d91df5e77c8a6f2d61 | [
"Apache-2.0"
] | 7 | 2018-07-17T12:36:52.000Z | 2022-01-04T14:34:43.000Z | pyLMS7002Soapy/LMS7002_AFE.py | UCI-CubeSat/pyLMS7002Soapy | 4f828eb9282c302dc6b187d91df5e77c8a6f2d61 | [
"Apache-2.0"
] | 25 | 2018-04-29T23:15:25.000Z | 2022-01-04T11:39:36.000Z | # ***************************************************************
# * Name: LMS7002_AFE.py
# * Purpose: Class implementing LMS7002 AFE functions
# * Author: Lime Microsystems ()
# * Created: 2016-11-14
# * Copyright: Lime Microsystems (limemicro.com)
# * License:
# ******************************************... | 25.469072 | 65 | 0.526816 |
from pyLMS7002Soapy.LMS7002_base import LMS7002_base
class LMS7002_AFE(LMS7002_base):
__slots__ = []
def __init__(self, chip):
self.chip = chip
self.channel = None
self.prefix = "AFE_"
@property
def ISEL_DAC_AFE(self):
return self._readReg('CFG', 'I... | true | true |
08fef8c1b8e68cdd03809ae04f73a058717b37bf | 321 | py | Python | src/scraper/__init__.py | fontune/inventory-hunter | c0afa94a45121141b23b8b484d5101251d587311 | [
"MIT"
] | null | null | null | src/scraper/__init__.py | fontune/inventory-hunter | c0afa94a45121141b23b8b484d5101251d587311 | [
"MIT"
] | null | null | null | src/scraper/__init__.py | fontune/inventory-hunter | c0afa94a45121141b23b8b484d5101251d587311 | [
"MIT"
] | null | null | null | import scraper.adorama
import scraper.amazon
import scraper.bestbuy
import scraper.bhphotovideo
import scraper.microcenter
import scraper.newegg
import scraper.walmart
from scraper.common import ScraperFactory
def init_scrapers(config, drivers):
return [ScraperFactory.create(drivers, url) for url in config.urls]... | 22.928571 | 71 | 0.831776 | import scraper.adorama
import scraper.amazon
import scraper.bestbuy
import scraper.bhphotovideo
import scraper.microcenter
import scraper.newegg
import scraper.walmart
from scraper.common import ScraperFactory
def init_scrapers(config, drivers):
return [ScraperFactory.create(drivers, url) for url in config.urls]... | true | true |
08fef9b9b7c2552e76d6a5998228597ef3be4910 | 777 | py | Python | create_folder.py | Deyui/Art-Rewards-Project | fc58b0937ed26c0dc1ac2e2096de9a68440fba19 | [
"MIT"
] | null | null | null | create_folder.py | Deyui/Art-Rewards-Project | fc58b0937ed26c0dc1ac2e2096de9a68440fba19 | [
"MIT"
] | null | null | null | create_folder.py | Deyui/Art-Rewards-Project | fc58b0937ed26c0dc1ac2e2096de9a68440fba19 | [
"MIT"
] | null | null | null | from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
drive = GoogleDrive(gauth)
users = ['a', 'b', 'Liao']
def create_folder(users):
folder_name = users
folder = drive.CreateFile({'title' : folder_name, 'mimeType' : 'application/vnd.google-apps.folder'})
folder.U... | 27.75 | 105 | 0.706564 | from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
gauth = GoogleAuth()
drive = GoogleDrive(gauth)
users = ['a', 'b', 'Liao']
def create_folder(users):
folder_name = users
folder = drive.CreateFile({'title' : folder_name, 'mimeType' : 'application/vnd.google-apps.folder'})
folder.U... | true | true |
08fefb19d5348786aa46a024c0126dbda6d680e2 | 24,944 | py | Python | g2p_seq2seq/g2p.py | johnson1228/g2p-seq2seq | 2fac457e066df48038a7682be69f3bd8b9fff916 | [
"Apache-2.0"
] | null | null | null | g2p_seq2seq/g2p.py | johnson1228/g2p-seq2seq | 2fac457e066df48038a7682be69f3bd8b9fff916 | [
"Apache-2.0"
] | null | null | null | g2p_seq2seq/g2p.py | johnson1228/g2p-seq2seq | 2fac457e066df48038a7682be69f3bd8b9fff916 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 AC Technologies LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 37.908815 | 93 | 0.668658 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import os
import re
import numpy as np
import six
import sys
from tensor2tensor.data_generators.problem import problem_hparams_to_features
import tensorflow as tf
from tensorflow.python.esti... | true | true |
08fefb81db0865b23053cfd8458223aac0653b8a | 424 | py | Python | ltr/admin/local.py | tsingqguo/AttackTracker | 054268d5afa0044675c7acf1ac13e621f1c9549e | [
"Apache-2.0"
] | 11 | 2020-11-25T16:19:23.000Z | 2022-01-12T08:08:47.000Z | ltr/admin/local.py | tsingqguo/AttackTracker | 054268d5afa0044675c7acf1ac13e621f1c9549e | [
"Apache-2.0"
] | null | null | null | ltr/admin/local.py | tsingqguo/AttackTracker | 054268d5afa0044675c7acf1ac13e621f1c9549e | [
"Apache-2.0"
] | null | null | null | class EnvironmentSettings:
def __init__(self):
self.workspace_dir = '' # Base directory for saving network checkpoints.
self.tensorboard_dir = self.workspace_dir + '/tensorboard/' # Directory for tensorboard files.
self.lasot_dir = ''
self.got10k_dir = ''
self.trackingn... | 38.545455 | 105 | 0.622642 | class EnvironmentSettings:
def __init__(self):
self.workspace_dir = '' self.tensorboard_dir = self.workspace_dir + '/tensorboard/' self.lasot_dir = ''
self.got10k_dir = ''
self.trackingnet_dir = ''
self.coco_dir = ''
self.imagenet_dir = ''
self.i... | true | true |
08fefbe83cf7894b466f725bdfd94c20dc882190 | 3,317 | py | Python | test.py | JiaxiongQ/SlimConv | 88c0e20e75ab878e5f2bd8190309e0f9cdc58b1f | [
"MIT"
] | 13 | 2020-06-14T03:07:22.000Z | 2021-12-28T06:20:48.000Z | test.py | JiaxiongQ/SlimConv | 88c0e20e75ab878e5f2bd8190309e0f9cdc58b1f | [
"MIT"
] | 3 | 2020-08-10T11:56:08.000Z | 2021-09-29T10:34:33.000Z | test.py | JiaxiongQ/SlimConv | 88c0e20e75ab878e5f2bd8190309e0f9cdc58b1f | [
"MIT"
] | 2 | 2020-08-19T07:03:29.000Z | 2021-12-20T03:29:00.000Z |
import time
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import os
import argparse
# from models import *
from .SC-ResNet... | 29.096491 | 90 | 0.601146 |
import time
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import os
import argparse
from .SC-ResNet import *
from utils im... | false | true |
08fefbef42fcc7dfe7af5ecc0ce988dbbb4fb28e | 10,100 | py | Python | src/synthetic_heatmap/generators/stop_sign.py | sebastiengilbert73/synthetic_heatmap | 8a1f21f4eaf5a56374b77a4238be97a7005cdb58 | [
"MIT"
] | 1 | 2022-03-07T21:21:34.000Z | 2022-03-07T21:21:34.000Z | src/synthetic_heatmap/generators/stop_sign.py | sebastiengilbert73/synthetic_heatmap | 8a1f21f4eaf5a56374b77a4238be97a7005cdb58 | [
"MIT"
] | null | null | null | src/synthetic_heatmap/generators/stop_sign.py | sebastiengilbert73/synthetic_heatmap | 8a1f21f4eaf5a56374b77a4238be97a7005cdb58 | [
"MIT"
] | null | null | null | from synthetic_heatmap.generator import Generator, RegularPolygonVertices, WarpAffinePoints, DownloadRandomImage
import cv2
import numpy as np
import random
import math
import urllib.request
import os
class StopSign(Generator):
def __init__(self, octogon_diameter_range=(1.3, 1.3),
font_scale_range... | 52.604167 | 144 | 0.661089 | from synthetic_heatmap.generator import Generator, RegularPolygonVertices, WarpAffinePoints, DownloadRandomImage
import cv2
import numpy as np
import random
import math
import urllib.request
import os
class StopSign(Generator):
def __init__(self, octogon_diameter_range=(1.3, 1.3),
font_scale_range... | true | true |
08fefcf7e200abe41ae0a044b8c538a99cb3fbb5 | 309 | py | Python | src/api/pdi/application/connection/CheckDatabaseConnection/CheckDatabaseConnectionCommand.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | 1 | 2020-12-18T21:37:28.000Z | 2020-12-18T21:37:28.000Z | src/api/pdi/application/connection/CheckDatabaseConnection/CheckDatabaseConnectionCommand.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | null | null | null | src/api/pdi/application/connection/CheckDatabaseConnection/CheckDatabaseConnectionCommand.py | ahmetcagriakca/pythondataintegrator | 079b968d6c893008f02c88dbe34909a228ac1c7b | [
"MIT"
] | 1 | 2020-12-18T21:37:31.000Z | 2020-12-18T21:37:31.000Z | from dataclasses import dataclass
from pdip.cqrs import ICommand
from pdi.application.connection.CheckDatabaseConnection.CheckDatabaseConnectionRequest import \
CheckDatabaseConnectionRequest
@dataclass
class CheckDatabaseConnectionCommand(ICommand):
request: CheckDatabaseConnectionRequest = None
| 28.090909 | 95 | 0.860841 | from dataclasses import dataclass
from pdip.cqrs import ICommand
from pdi.application.connection.CheckDatabaseConnection.CheckDatabaseConnectionRequest import \
CheckDatabaseConnectionRequest
@dataclass
class CheckDatabaseConnectionCommand(ICommand):
request: CheckDatabaseConnectionRequest = None
| true | true |
08fefcfaaa754788727b55fb39a6ef8f2c3a1539 | 724 | py | Python | algoritmo2.py | giaba90/python-thesis | 8a6d951fc3a1e58b510b7f3f9d1df6ef109711e3 | [
"MIT"
] | null | null | null | algoritmo2.py | giaba90/python-thesis | 8a6d951fc3a1e58b510b7f3f9d1df6ef109711e3 | [
"MIT"
] | null | null | null | algoritmo2.py | giaba90/python-thesis | 8a6d951fc3a1e58b510b7f3f9d1df6ef109711e3 | [
"MIT"
] | null | null | null | from itertools import combinations
import numpy as np
import utility
def sol2(vet1, indice, vet_in):
out = []
while indice >= 1:
# converto in lista la combinations
vet2 = list(combinations(vet1, indice))
for riga in vet2:
# trasformo il vettore in input in un array
... | 31.478261 | 81 | 0.562155 | from itertools import combinations
import numpy as np
import utility
def sol2(vet1, indice, vet_in):
out = []
while indice >= 1:
vet2 = list(combinations(vet1, indice))
for riga in vet2:
tmp = np.array(riga)
tmp = tmp.sum(axis=0)
... | true | true |
08fefdc2479905e0a99367f597171a641136dec9 | 3,244 | py | Python | examples/kubernetes/scripts/hmem_experiments/kernel_parameters.py | wacuuu/workload-collocation-agent | 9250ec2ab8def033e8546481eaed6aca2caad3d3 | [
"Apache-2.0"
] | null | null | null | examples/kubernetes/scripts/hmem_experiments/kernel_parameters.py | wacuuu/workload-collocation-agent | 9250ec2ab8def033e8546481eaed6aca2caad3d3 | [
"Apache-2.0"
] | null | null | null | examples/kubernetes/scripts/hmem_experiments/kernel_parameters.py | wacuuu/workload-collocation-agent | 9250ec2ab8def033e8546481eaed6aca2caad3d3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Intel Corporation
#
# 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... | 42.12987 | 96 | 0.736745 | import logging
import subprocess
NUMA_BALANCING_FILE = '/proc/sys/kernel/numa_balancing'
TOPTIER_BALANCING_FILE = '/proc/sys/vm/toptier_scale_factor'
NUMA_BALANCING_HOT_THRESHOLD = '/proc/sys/kernel/numa_balancing_hot_threshold_ms'
NUMA_BALANCING_RATE_LIMIT = '/proc/sys/kernel/numa_balancing_rate_limit_mbps'
NUMA_BAL... | true | true |
08fefddfd264d7bd9ee73ea749907010cb0a5026 | 531 | py | Python | metadeploy/api/migrations/0059_plantemplate_product.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 33 | 2019-03-20T15:34:39.000Z | 2022-03-30T15:59:40.000Z | metadeploy/api/migrations/0059_plantemplate_product.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 2,718 | 2019-02-27T19:46:07.000Z | 2022-03-11T23:18:09.000Z | metadeploy/api/migrations/0059_plantemplate_product.py | sfdc-qbranch/MetaDeploy | d22547b3814dbec6aefa4d86b9f81c6f175c1b67 | [
"BSD-3-Clause"
] | 28 | 2019-03-28T04:57:16.000Z | 2022-02-04T16:49:25.000Z | # Generated by Django 2.1.7 on 2019-03-04 19:37
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0058_move_plan_slug_parent")]
operations = [
migrations.AddField(
model_name="plantemplate",
... | 24.136364 | 61 | 0.585687 |
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("api", "0058_move_plan_slug_parent")]
operations = [
migrations.AddField(
model_name="plantemplate",
name="product",
field=models.For... | true | true |
08fefe9ea827d6fc5ed3d4b08a320d0c46c7bdd0 | 2,763 | py | Python | tests/hl_decoder.py | OnBeep/python-opus | 92109c528f9f6c550df5e5325ca0fcd4f86b0909 | [
"BSD-3-Clause"
] | 27 | 2015-10-19T03:00:08.000Z | 2020-01-25T10:41:38.000Z | tests/hl_decoder.py | OnBeep/python-opus | 92109c528f9f6c550df5e5325ca0fcd4f86b0909 | [
"BSD-3-Clause"
] | 11 | 2015-11-22T15:35:00.000Z | 2019-07-29T09:26:52.000Z | tests/hl_decoder.py | OnBeep/python-opus | 92109c528f9f6c550df5e5325ca0fcd4f86b0909 | [
"BSD-3-Clause"
] | 18 | 2015-10-13T08:43:44.000Z | 2019-08-10T20:44:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
#
"""Tests for a high-level Decoder object"""
import unittest
import opuslib
__author__ = 'Никита Кузнецов <self@svartalf.info>'
__copyright__ = 'Copyright (c) 2012, SvartalF'
__license__ = 'BSD 3-Clause License'
class DecoderTest(u... | 26.825243 | 64 | 0.605501 |
import unittest
import opuslib
__author__ = 'Никита Кузнецов <self@svartalf.info>'
__copyright__ = 'Copyright (c) 2012, SvartalF'
__license__ = 'BSD 3-Clause License'
class DecoderTest(unittest.TestCase):
def test_create(self):
try:
opuslib.Decoder(1000, 3)
except opuslib.OpusErro... | true | true |
08fefeaa4733c45d26c94da3e2221ed3e13ac186 | 27,361 | py | Python | integration_test/src/python/topology_test_runner/main.py | aaronstjohn/incubator-heron | bdc35f8d23296472983956a477ea38da54d16b2b | [
"Apache-2.0"
] | null | null | null | integration_test/src/python/topology_test_runner/main.py | aaronstjohn/incubator-heron | bdc35f8d23296472983956a477ea38da54d16b2b | [
"Apache-2.0"
] | 1 | 2019-05-08T22:30:16.000Z | 2019-05-08T22:30:16.000Z | integration_test/src/python/topology_test_runner/main.py | aaronstjohn/incubator-heron | bdc35f8d23296472983956a477ea38da54d16b2b | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.118768 | 104 | 0.711999 | import argparse
import json
import logging
import os
import pkgutil
import re
import sys
import time
import uuid
from httplib import HTTPConnection
from threading import Lock, Thread
from ..common import status
from heron.common.src.python.utils import log
from heron.statemgrs.src.python import configloader
from heron... | true | true |
08feff1ab97e77ed160ed617d11b6b7f27843bf0 | 428 | py | Python | P03/ex08_math.py | ChanganXLTZ/project_test | b6aa323de105beb6281045bf7b89ed3857ed3d9f | [
"CNRI-Python"
] | 1 | 2018-09-16T13:51:06.000Z | 2018-09-16T13:51:06.000Z | P03/ex08_math.py | ChanganXLTZ/project_test | b6aa323de105beb6281045bf7b89ed3857ed3d9f | [
"CNRI-Python"
] | null | null | null | P03/ex08_math.py | ChanganXLTZ/project_test | b6aa323de105beb6281045bf7b89ed3857ed3d9f | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
a = 2
b = 10
print('a+b:',a+b)
print('a*b:',a*b)
print('a/b:',a/b)
print('a//b:',a//b)
print('a%b:',a%b)
print('a**b:',a**b)
print('正常除法结果的数据类型:',type(10/2)) # 正常除法,能整除开也返回浮点型
print('整除运算结果的数据类型:',type(a//b)) # 整除,返回整型
print('浮点数整除结果的数据类型:',type(12.2//3.4))#混合计... | 23.777778 | 60 | 0.584112 | a = 2
b = 10
print('a+b:',a+b)
print('a*b:',a*b)
print('a/b:',a/b)
print('a//b:',a//b)
print('a%b:',a%b)
print('a**b:',a**b)
print('正常除法结果的数据类型:',type(10/2)) print('整除运算结果的数据类型:',type(a//b)) print('浮点数整除结果的数据类型:',type(12.2//3.4))
i_a = a+2j
i_b = complex(a,b)
print('实部类型:',type(i_a),'虚部类型:',type(i_b)) | true | true |
08ff003acd90e860c3a7ab4222d6a85ce77577ff | 28 | py | Python | src/ip2whois/__init__.py | ip2whois/ip2whois-python | 79af46c585e3d1e48135b2b985ce51d9a83fced5 | [
"MIT"
] | 1 | 2021-11-22T02:36:04.000Z | 2021-11-22T02:36:04.000Z | src/ip2whois/__init__.py | ip2whois/ip2whois-python | 79af46c585e3d1e48135b2b985ce51d9a83fced5 | [
"MIT"
] | null | null | null | src/ip2whois/__init__.py | ip2whois/ip2whois-python | 79af46c585e3d1e48135b2b985ce51d9a83fced5 | [
"MIT"
] | null | null | null | from ip2whois.api import Api | 28 | 28 | 0.857143 | from ip2whois.api import Api | true | true |
08ff00b24478c30e1a0d1d8e710cd7409f33bd68 | 31,722 | py | Python | appengine/monorail/features/test/autolink_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/monorail/features/test/autolink_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | 16 | 2020-09-07T11:55:09.000Z | 2022-03-02T05:47:58.000Z | appengine/monorail/features/test/autolink_test.py | xinghun61/infra | b5d4783f99461438ca9e6a477535617fadab6ba3 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 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 or at
# https://developers.google.com/open-source/licenses/bsd
"""Unittest for the autolink feature."""
from __future__ import print_function
from __future__ ... | 39.162963 | 79 | 0.6655 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import re
import unittest
from features import autolink
from features import autolink_constants
from framework import template_helpers
from proto import tracker_pb2
from testing import fake
from testing impor... | true | true |
08ff012371a754b98e965e0fe08bc5e222e4234e | 4,820 | py | Python | addons/website_sale_coupon/models/sale_order.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/website_sale_coupon/models/sale_order.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/website_sale_coupon/models/sale_order.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import timedelta
from odoo import api, fields, models
from odoo.http import request
class SaleOrder(models.Model):
_inherit = "sale.order"
def _compute_website_order_line(self):
""" This method will merge multiple discount lines generated by a same program
... | 50.208333 | 144 | 0.622614 | from datetime import timedelta
from odoo import api, fields, models
from odoo.http import request
class SaleOrder(models.Model):
_inherit = "sale.order"
def _compute_website_order_line(self):
super()._compute_website_order_line()
for order in self:
programs = order._g... | true | true |
08ff0190d2a8be221cd7f70ac4eb7f88910624c8 | 733 | py | Python | examples/quick_start/nested_list.py | timdavis3991/do-py | 921d3b3bdeb108f3e6379dcacab6ed6ffaaa0776 | [
"MIT"
] | 7 | 2020-07-07T02:53:44.000Z | 2022-03-28T00:56:36.000Z | examples/quick_start/nested_list.py | timdavis3991/do-py | 921d3b3bdeb108f3e6379dcacab6ed6ffaaa0776 | [
"MIT"
] | 31 | 2020-03-24T17:55:05.000Z | 2022-03-31T04:27:14.000Z | examples/quick_start/nested_list.py | timdavis3991/do-py | 921d3b3bdeb108f3e6379dcacab6ed6ffaaa0776 | [
"MIT"
] | null | null | null | """
Nest a list of DataObjects in another DataObject.
"""
from do_py import DataObject, R
from do_py.common.managed_list import ManagedList
class Book(DataObject):
"""
There are multiple books in the library!
:restriction name: Name of the book.
:restriction author: The author of the book.
"""
... | 24.433333 | 71 | 0.643929 | from do_py import DataObject, R
from do_py.common.managed_list import ManagedList
class Book(DataObject):
_restrictions = {
'name': R.STR,
'author': R.STR,
}
class Library(DataObject):
_restrictions = {
'city': R.STR,
'books': ManagedList(Book)
}
| true | true |
08ff01ada2e308d840e975ece271af7e6646c58c | 17,476 | py | Python | utilities/sparse_image_warp_pytorch.py | Jingqiao-Zhao/DCASE2020-Task1-SubtaskB | b9474ad68751a7201323364de34bd9630f76f74c | [
"MIT"
] | 6 | 2020-06-19T07:17:48.000Z | 2021-09-17T00:10:34.000Z | utilities/sparse_image_warp_pytorch.py | Jingqiao-Zhao/DCASE2020-Task1-SubtaskB | b9474ad68751a7201323364de34bd9630f76f74c | [
"MIT"
] | 1 | 2021-05-11T07:00:21.000Z | 2021-05-15T06:05:29.000Z | utilities/sparse_image_warp_pytorch.py | Jingqiao-Zhao/DCASE2020-Task1-SubtaskB | b9474ad68751a7201323364de34bd9630f76f74c | [
"MIT"
] | 3 | 2020-07-05T04:49:58.000Z | 2021-06-09T02:33:05.000Z | # Copyright 2019 RnD at Spoon Radio
#
# 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 applicabl... | 21.338217 | 114 | 0.617304 |
import random
import numpy as np
import torch
def time_warp(spec, W=5):
spec = spec.view(1, spec.shape[0], spec.shape[1])
num_rows = spec.shape[1]
spec_len = spec.shape[2]
y = num_rows // 2
horizontal_line_at_ctr = s... | true | true |
08ff01d9adcff46592a48a4db83b73627bd5f1f0 | 3,456 | py | Python | bindings/python/ensmallen/datasets/string/vibriogalatheae.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/vibriogalatheae.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/vibriogalatheae.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Vibrio galatheae.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein assoc... | 32.914286 | 223 | 0.676215 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def VibrioGalatheae(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string",
... | true | true |
08ff02663f82fe41294410ac7a2f0b0fb0cd6c3c | 1,639 | py | Python | azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure/mgmt/network/v2016_12_01/models/application_gateway_backend_health_server.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 40.975 | 89 | 0.643685 |
from msrest.serialization import Model
class ApplicationGatewayBackendHealthServer(Model):
_attribute_map = {
'address': {'key': 'address', 'type': 'str'},
'ip_configuration': {'key': 'ipConfiguration', 'type': 'SubResource'},
'health': {'key': 'health', 'type': 'str'},
}
def __... | true | true |
08ff0475a3d080d19434a02f52cdbcb864d73ff1 | 3,137 | py | Python | my_lambdata/ds_utilities.py | DrewRust/lambdata2-drewrust | c2fcd57bf898f5564225e06f465a1b11671b08cf | [
"MIT"
] | null | null | null | my_lambdata/ds_utilities.py | DrewRust/lambdata2-drewrust | c2fcd57bf898f5564225e06f465a1b11671b08cf | [
"MIT"
] | null | null | null | my_lambdata/ds_utilities.py | DrewRust/lambdata2-drewrust | c2fcd57bf898f5564225e06f465a1b11671b08cf | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
# from sklearn.datasets import load_wine
# from pdb import set_trace as breakpoint
# from IPython.display import display
def enlarge(n):
'''
This function will multiple the input by 100
'''
return n * 100
cla... | 31.37 | 98 | 0.658272 | import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
def enlarge(n):
return n * 100
class Test_Split_Class:
def __init__(self, df, X, y):
self.df = df
self.X = X
self.y = y
def my_train_val_test_split(self):
train_1, test = train_tes... | true | true |
08ff05268812139b9781911b14a3a50390c955d2 | 146 | py | Python | examples/test_core_lib/core_lib/data_layers/data_access/test2_data_access.py | shubham-surya/core-lib | 543db80706746a937e5ed16bd50f2de8d58b32e4 | [
"MIT"
] | null | null | null | examples/test_core_lib/core_lib/data_layers/data_access/test2_data_access.py | shubham-surya/core-lib | 543db80706746a937e5ed16bd50f2de8d58b32e4 | [
"MIT"
] | 9 | 2021-03-11T02:29:17.000Z | 2022-03-22T19:01:18.000Z | examples/test_core_lib/core_lib/data_layers/data_access/test2_data_access.py | shubham-surya/core-lib | 543db80706746a937e5ed16bd50f2de8d58b32e4 | [
"MIT"
] | 2 | 2022-01-27T11:19:00.000Z | 2022-02-11T11:33:09.000Z | from core_lib.data_layers.data_access.data_access import DataAccess
class Test2DataAccess(DataAccess):
def get_value(self):
return 2 | 24.333333 | 67 | 0.780822 | from core_lib.data_layers.data_access.data_access import DataAccess
class Test2DataAccess(DataAccess):
def get_value(self):
return 2 | true | true |
08ff05688549da1e17b71e263b1d014dadef569c | 7,851 | py | Python | codebase/third_party/spos_ofa/ofa/imagenet_classification/networks/mobilenet_v3_cifar.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | codebase/third_party/spos_ofa/ofa/imagenet_classification/networks/mobilenet_v3_cifar.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | codebase/third_party/spos_ofa/ofa/imagenet_classification/networks/mobilenet_v3_cifar.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | # Once for All: Train One Network and Specialize it for Efficient Deployment
# Han Cai, Chuang Gan, Tianzhe Wang, Zhekai Zhang, Song Han
# International Conference on Learning Representations (ICLR), 2020.
import copy
import torch.nn as nn
from codebase.third_party.spos_ofa.ofa.utils.layers import set_layer_from_conf... | 35.849315 | 147 | 0.707808 |
import copy
import torch.nn as nn
from codebase.third_party.spos_ofa.ofa.utils.layers import set_layer_from_config, MBConvLayer, ConvLayer, IdentityLayer, LinearLayer, ResidualBlock
from codebase.third_party.spos_ofa.ofa.utils import MyNetwork, make_divisible, MyGlobalAvgPool2d
__all__ = ['MobileNetV3Cifar', 'Mobile... | true | true |
08ff0573ed4c2398e51969ca9016c6d1cdd8b85f | 6,615 | py | Python | odml/gui/EditorTab.py | carloscanova/python-odml | dff793bff86187b67be139c0f32c7cd036ba8db4 | [
"BSD-4-Clause"
] | null | null | null | odml/gui/EditorTab.py | carloscanova/python-odml | dff793bff86187b67be139c0f32c7cd036ba8db4 | [
"BSD-4-Clause"
] | null | null | null | odml/gui/EditorTab.py | carloscanova/python-odml | dff793bff86187b67be139c0f32c7cd036ba8db4 | [
"BSD-4-Clause"
] | null | null | null | import gtk
import gio
import os.path
import odml
import odml.validation
from odml.tools.xmlparser import XMLWriter, XMLReader
from CommandManager import CommandManager
from ValidationWindow import ValidationWindow
class EditorTab(object):
"""
Represents a Document Object in the Editor
"""
file_uri = ... | 32.586207 | 109 | 0.622525 | import gtk
import gio
import os.path
import odml
import odml.validation
from odml.tools.xmlparser import XMLWriter, XMLReader
from CommandManager import CommandManager
from ValidationWindow import ValidationWindow
class EditorTab(object):
"""
Represents a Document Object in the Editor
"""
file_uri = ... | false | true |
08ff0574a97926359ed3aa97cabde2e103e1b214 | 1,770 | py | Python | _unittests/ut_dnotebooks/test_2A_notebook.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | _unittests/ut_dnotebooks/test_2A_notebook.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | _unittests/ut_dnotebooks/test_2A_notebook.py | mohamedelkansouli/Ensae_py | 8bc867bd2081c259c793fadfa8be5dcc7bd1400b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@brief test log(time=23s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, skipif_appveyor, skipif_travis, add_missing_development_version
try:
import src
except ImportError:
path = os.path.norm... | 30 | 124 | 0.601695 |
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder, skipif_appveyor, skipif_travis, add_missing_development_version
try:
import src
except ImportError:
path = os.path.normpath(
os.path.abspath(
os.path.join(
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.