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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f758b0c60a3c795bf8bae04b36a4baa6a53ba62f | 274 | py | Python | ch_5/plot_w.py | ProhardONE/python_primer | 211e37c1f2fd169269fc4f3c08e8b7e5225f2ad0 | [
"MIT"
] | 51 | 2016-04-05T16:56:11.000Z | 2022-02-08T00:08:47.000Z | ch_5/plot_w.py | zhangxiao921207/python_primer | 211e37c1f2fd169269fc4f3c08e8b7e5225f2ad0 | [
"MIT"
] | null | null | null | ch_5/plot_w.py | zhangxiao921207/python_primer | 211e37c1f2fd169269fc4f3c08e8b7e5225f2ad0 | [
"MIT"
] | 47 | 2016-05-02T07:51:37.000Z | 2022-02-08T01:28:15.000Z | # Exercise 5.35
# Author: Noah Waterfield Price
import numpy as np
import matplotlib.pyplot as plt
def f(x):
r = np.zeros(len(x))
r[x < 0] = -x[x < 0] - 5
r[x >= 0] = x[x >= 0] - 5
return abs(r)
x = np.linspace(-10, 10, 101)
plt.plot(x, f(x))
plt.show()
| 16.117647 | 31 | 0.562044 |
import numpy as np
import matplotlib.pyplot as plt
def f(x):
r = np.zeros(len(x))
r[x < 0] = -x[x < 0] - 5
r[x >= 0] = x[x >= 0] - 5
return abs(r)
x = np.linspace(-10, 10, 101)
plt.plot(x, f(x))
plt.show()
| true | true |
f758b1cb23ba19b776dd92e691f5c878c0fd8cb1 | 485 | py | Python | setup.py | iparshin/schematic-file-converter | 3d4dfaa1544a8aebff3b9f9f646a20bf27dad9c3 | [
"Apache-2.0"
] | 1 | 2016-09-05T17:18:33.000Z | 2016-09-05T17:18:33.000Z | setup.py | iparshin/schematic-file-converter | 3d4dfaa1544a8aebff3b9f9f646a20bf27dad9c3 | [
"Apache-2.0"
] | null | null | null | setup.py | iparshin/schematic-file-converter | 3d4dfaa1544a8aebff3b9f9f646a20bf27dad9c3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup, find_packages
packages = ['upconvert.' + p for p in find_packages('upconvert', exclude=['test', 'test*', '*.t'])]
packages.append('upconvert')
setup(
name='python-upconvert',
maintainer='Upverter Inc.',
maintainer_email='opensource@upverter.com',
ve... | 26.944444 | 99 | 0.68866 |
from setuptools import setup, find_packages
packages = ['upconvert.' + p for p in find_packages('upconvert', exclude=['test', 'test*', '*.t'])]
packages.append('upconvert')
setup(
name='python-upconvert',
maintainer='Upverter Inc.',
maintainer_email='opensource@upverter.com',
version='0.3',
descr... | true | true |
f758b34d9f8ef6e9eea83cc041aff609a483d2b2 | 14,426 | py | Python | cimcb_lite/model/BaseModel.py | KevinMMendez/cimcb_lite | 1e6cf7137cd04d6be4ad1ba6fd317077ace08ee8 | [
"MIT"
] | 1 | 2019-03-19T13:18:56.000Z | 2019-03-19T13:18:56.000Z | cimcb_lite/model/BaseModel.py | KevinMMendez/cimcb_lite | 1e6cf7137cd04d6be4ad1ba6fd317077ace08ee8 | [
"MIT"
] | 1 | 2019-03-24T11:04:39.000Z | 2019-03-26T03:54:51.000Z | cimcb_lite/model/BaseModel.py | KevinMMendez/cimcb_lite | 1e6cf7137cd04d6be4ad1ba6fd317077ace08ee8 | [
"MIT"
] | 2 | 2019-03-23T08:03:33.000Z | 2019-05-08T06:12:53.000Z | from abc import ABC, abstractmethod, abstractproperty
import numpy as np
import pandas as pd
import scipy
from bokeh.layouts import widgetbox, gridplot, column, row, layout
from bokeh.models import HoverTool, Band
from bokeh.models.widgets import DataTable, Div, TableColumn
from bokeh.models.annotations import Title
fr... | 50.440559 | 398 | 0.623943 | from abc import ABC, abstractmethod, abstractproperty
import numpy as np
import pandas as pd
import scipy
from bokeh.layouts import widgetbox, gridplot, column, row, layout
from bokeh.models import HoverTool, Band
from bokeh.models.widgets import DataTable, Div, TableColumn
from bokeh.models.annotations import Title
fr... | true | true |
f758b351d7ace4694a08331d47668db95f7c7ca6 | 1,115 | py | Python | dvc/utils/pager.py | jheister/dvc | 69db63dfba42ff0b32356df362d764daebb0e728 | [
"Apache-2.0"
] | 1 | 2021-06-18T19:36:13.000Z | 2021-06-18T19:36:13.000Z | dvc/utils/pager.py | jheister/dvc | 69db63dfba42ff0b32356df362d764daebb0e728 | [
"Apache-2.0"
] | 82 | 2021-05-04T02:40:05.000Z | 2022-03-31T03:14:04.000Z | dvc/utils/pager.py | andreyferriyan/dvc | daf07451f8e8f3e76a791c696b0ea175e8ed3ac1 | [
"Apache-2.0"
] | null | null | null | """Draws DAG in ASCII."""
import logging
import os
import pydoc
import sys
from rich.pager import Pager
from dvc.env import DVC_PAGER
from dvc.utils import format_link
logger = logging.getLogger(__name__)
DEFAULT_PAGER = "less"
DEFAULT_PAGER_FORMATTED = (
f"{DEFAULT_PAGER} --chop-long-lines --clear-screen --R... | 19.910714 | 75 | 0.661883 |
import logging
import os
import pydoc
import sys
from rich.pager import Pager
from dvc.env import DVC_PAGER
from dvc.utils import format_link
logger = logging.getLogger(__name__)
DEFAULT_PAGER = "less"
DEFAULT_PAGER_FORMATTED = (
f"{DEFAULT_PAGER} --chop-long-lines --clear-screen --RAW-CONTROL-CHARS"
)
def ... | true | true |
f758b372cfb93f2e61a296509832eb4c3873e01d | 2,166 | py | Python | airbyte-integrations/connectors/source-talkdesk-explore/source_talkdesk_explore/source.py | onaio/airbyte | 38302e82a25f1b66742c3febfbff0668556920f2 | [
"MIT"
] | 22 | 2020-08-27T00:47:20.000Z | 2020-09-17T15:39:39.000Z | airbyte-integrations/connectors/source-talkdesk-explore/source_talkdesk_explore/source.py | onaio/airbyte | 38302e82a25f1b66742c3febfbff0668556920f2 | [
"MIT"
] | 116 | 2020-08-27T01:11:27.000Z | 2020-09-19T02:47:52.000Z | airbyte-integrations/connectors/source-talkdesk-explore/source_talkdesk_explore/source.py | onaio/airbyte | 38302e82a25f1b66742c3febfbff0668556920f2 | [
"MIT"
] | 1 | 2020-09-15T06:10:01.000Z | 2020-09-15T06:10:01.000Z | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from typing import Any, List, Mapping, Tuple
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator
fro... | 42.470588 | 144 | 0.713296 |
from typing import Any, List, Mapping, Tuple
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources.streams.http.auth import TokenAuthenticator
from .streams import Calls, Contacts, RingAttempts, StudioFlowEx... | true | true |
f758b378ab95d346820eece26b219f9fe9e593fc | 833 | py | Python | Python/xml2csv.py | lonelycoder2004/hacktoberfest2020-3 | b481f995ea1a8c25aa4e467d43b334e118025a8b | [
"MIT"
] | 71 | 2020-10-06T05:53:59.000Z | 2021-11-27T03:14:42.000Z | Python/xml2csv.py | lonelycoder2004/hacktoberfest2020-3 | b481f995ea1a8c25aa4e467d43b334e118025a8b | [
"MIT"
] | 92 | 2020-10-05T19:18:14.000Z | 2021-10-09T04:35:16.000Z | Python/xml2csv.py | lonelycoder2004/hacktoberfest2020-3 | b481f995ea1a8c25aa4e467d43b334e118025a8b | [
"MIT"
] | 572 | 2020-10-05T20:11:28.000Z | 2021-10-10T16:28:29.000Z | import xml.etree.ElementTree as ET
from tkinter.filedialog import askopenfilename
import os
import csv
def readFile(filename):
if not os.path.exists(filename): return
tree = ET.parse(filename)
root = tree.getroot()
#############################################
dict_keys = []
dict_keys = [item for item in input... | 21.921053 | 72 | 0.629052 | import xml.etree.ElementTree as ET
from tkinter.filedialog import askopenfilename
import os
import csv
def readFile(filename):
if not os.path.exists(filename): return
tree = ET.parse(filename)
root = tree.getroot()
dict_keys = []
dict_keys = [item for item in input("Enter the key values:\n").split()]
mdlis... | true | true |
f758b397558fdca32b74c0ca9f55cdfd92828831 | 5,027 | py | Python | ServidorPython/python32_web/Lib/site-packages/jsonschema/_utils.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 4 | 2020-02-05T11:26:47.000Z | 2021-05-26T07:48:46.000Z | ServidorPython/python32_web/Lib/site-packages/jsonschema/_utils.py | mak213k/Servidor_automatizado_python | 4403ef8027a2f814220baacc95856cf5fbf01d21 | [
"MIT"
] | 9 | 2019-12-05T00:49:12.000Z | 2021-09-08T01:31:25.000Z | backend/env/lib/python3.7/site-packages/jsonschema/_utils.py | US579/Seddit | 116a676efd0fa31c8cc6fe4c723b739203d9428b | [
"MIT"
] | 2 | 2019-08-28T14:57:54.000Z | 2019-11-26T16:18:30.000Z | import itertools
import json
import pkgutil
import re
from jsonschema.compat import MutableMapping, str_types, urlsplit
class URIDict(MutableMapping):
"""
Dictionary which uses normalized URIs as keys.
"""
def normalize(self, uri):
return urlsplit(uri).geturl()
def __init__(self, *args... | 23.059633 | 78 | 0.60374 | import itertools
import json
import pkgutil
import re
from jsonschema.compat import MutableMapping, str_types, urlsplit
class URIDict(MutableMapping):
def normalize(self, uri):
return urlsplit(uri).geturl()
def __init__(self, *args, **kwargs):
self.store = dict()
self.store.update(*... | true | true |
f758b4059a9d9557fa4f5a4b1e0f09cc46f3a30f | 687 | py | Python | configs/swin_zzy/htc_swin_tiny_3x_coco.py | nbl97/det | a38f3959c9f2cced4f445ac89d2d3010e479b684 | [
"Apache-2.0"
] | 1 | 2021-06-18T03:11:27.000Z | 2021-06-18T03:11:27.000Z | configs/swin_zzy/htc_swin_tiny_3x_coco.py | nbl97/det | a38f3959c9f2cced4f445ac89d2d3010e479b684 | [
"Apache-2.0"
] | null | null | null | configs/swin_zzy/htc_swin_tiny_3x_coco.py | nbl97/det | a38f3959c9f2cced4f445ac89d2d3010e479b684 | [
"Apache-2.0"
] | 1 | 2021-06-18T20:10:46.000Z | 2021-06-18T20:10:46.000Z | _base_ = 'htc_swin_base.py'
model = dict(
pretrained='pretrained/swin_tiny_patch4_window7_224.pth',
roi_head=dict(
semantic_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
out_channels=256,
... | 32.714286 | 78 | 0.598253 | _base_ = 'htc_swin_base.py'
model = dict(
pretrained='pretrained/swin_tiny_patch4_window7_224.pth',
roi_head=dict(
semantic_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', output_size=14, sampling_ratio=0),
out_channels=256,
... | true | true |
f758b661028fa08686c5adcc06de614ddb56b14a | 1,284 | py | Python | capture_and_uploadImage.py | khushmax/automation | 14398b52a6e084fb6e7d41dd3ca87f7ca8d3e725 | [
"MIT"
] | null | null | null | capture_and_uploadImage.py | khushmax/automation | 14398b52a6e084fb6e7d41dd3ca87f7ca8d3e725 | [
"MIT"
] | null | null | null | capture_and_uploadImage.py | khushmax/automation | 14398b52a6e084fb6e7d41dd3ca87f7ca8d3e725 | [
"MIT"
] | null | null | null | import cv2
import dropbox
import time
import random
start_time = time.time()
def take_snapshot():
number = random.randint(0,100)
#initializing cv2
videoCaptureObject = cv2.VideoCapture(0)
result = True
while(result):
#read the frames while the camera is on
ret,frame = videoCapture... | 26.204082 | 85 | 0.665888 | import cv2
import dropbox
import time
import random
start_time = time.time()
def take_snapshot():
number = random.randint(0,100)
videoCaptureObject = cv2.VideoCapture(0)
result = True
while(result):
ret,frame = videoCaptureObject.read()
img_name = "img"+str(number)... | true | true |
f758b719fecfb756f7c76e0c1e8d41d3026a60c4 | 3,460 | py | Python | bin/application.py | TNODigitalInnovations/ryu | f0690bcbeeab9004178e8d3c90fbb08c242429e3 | [
"Apache-2.0"
] | 1 | 2019-05-21T12:05:57.000Z | 2019-05-21T12:05:57.000Z | bin/application.py | TNODigitalInnovations/ryu | f0690bcbeeab9004178e8d3c90fbb08c242429e3 | [
"Apache-2.0"
] | null | null | null | bin/application.py | TNODigitalInnovations/ryu | f0690bcbeeab9004178e8d3c90fbb08c242429e3 | [
"Apache-2.0"
] | 1 | 2021-05-01T18:13:01.000Z | 2021-05-01T18:13:01.000Z | # Copyright (C) 2011 Nippon Telegraph and Telephone 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 appli... | 40.705882 | 196 | 0.670809 |
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.lib.type_desc import BPFProgram
import os
class AnyMatchSwitch(app_manager.RyuApp):
... | false | true |
f758b82c0204eefd0e58228c761386658eada47c | 3,765 | py | Python | faculty/clients/workspace.py | taraganepola/faculty | ea63edf107c6e15c5ded5e71e6ec8a58d7e9d24c | [
"Apache-2.0"
] | 1 | 2021-06-22T12:27:18.000Z | 2021-06-22T12:27:18.000Z | faculty/clients/workspace.py | taraganepola/faculty | ea63edf107c6e15c5ded5e71e6ec8a58d7e9d24c | [
"Apache-2.0"
] | null | null | null | faculty/clients/workspace.py | taraganepola/faculty | ea63edf107c6e15c5ded5e71e6ec8a58d7e9d24c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Faculty Science Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 31.115702 | 78 | 0.667198 |
from enum import Enum
from collections import namedtuple
from marshmallow import fields, post_load, validates_schema, ValidationError
from marshmallow_enum import EnumField
from faculty.clients.base import BaseSchema, BaseClient
File = namedtuple("File", ["path", "name", "last_modified", "size"])
Directory = nam... | true | true |
f758b9f0025ba2eefc3f72eb3cc0341494c2a925 | 7,416 | py | Python | tensorboard/util/test_util.py | qzchenwl/tensorboard | e59ca8d45746f459d797f4e69377eda4433e1624 | [
"Apache-2.0"
] | null | null | null | tensorboard/util/test_util.py | qzchenwl/tensorboard | e59ca8d45746f459d797f4e69377eda4433e1624 | [
"Apache-2.0"
] | null | null | null | tensorboard/util/test_util.py | qzchenwl/tensorboard | e59ca8d45746f459d797f4e69377eda4433e1624 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.863014 | 79 | 0.675431 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import threading
import unittest
import tensorflow as tf
from tensorflow.python import tf2 as tensorflow_python_tf2
from tensorboard.compat.proto import event_pb2
from tensorboard.compat.proto import graph... | true | true |
f758ba6b62f9e9473f47fea0196ca008fff34aec | 6,811 | py | Python | gym/envs/dart/flatworm_swim_straight_reduced.py | DragonMyth/MyDartEnv | 5a5c40d0104e22e0493f823c41734776fb2e6790 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/dart/flatworm_swim_straight_reduced.py | DragonMyth/MyDartEnv | 5a5c40d0104e22e0493f823c41734776fb2e6790 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/dart/flatworm_swim_straight_reduced.py | DragonMyth/MyDartEnv | 5a5c40d0104e22e0493f823c41734776fb2e6790 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | import numpy as np
from gym import utils
from gym.envs.dart import dart_env
from .simple_water_world import BaseFluidSimulator
class DartFlatwormSwimStraightReducedEnv(dart_env.DartEnv, utils.EzPickle):
def __init__(self):
control_bounds = np.array([[1.0] * 12, [-1.0] * 12])
self.action_scale = np... | 43.660256 | 141 | 0.608868 | import numpy as np
from gym import utils
from gym.envs.dart import dart_env
from .simple_water_world import BaseFluidSimulator
class DartFlatwormSwimStraightReducedEnv(dart_env.DartEnv, utils.EzPickle):
def __init__(self):
control_bounds = np.array([[1.0] * 12, [-1.0] * 12])
self.action_scale = np... | true | true |
f758ba9d818aa3db7295ccf1be6b6120c83f8587 | 2,412 | py | Python | drivers/devices/kinect_azure/helper.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 23 | 2021-04-02T09:02:04.000Z | 2022-03-22T05:31:03.000Z | drivers/devices/kinect_azure/helper.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 35 | 2021-04-12T09:41:05.000Z | 2022-03-26T13:32:46.000Z | drivers/devices/kinect_azure/helper.py | takuya-ki/wrs | f6e1009b94332504042fbde9b39323410394ecde | [
"MIT"
] | 16 | 2021-03-30T11:55:45.000Z | 2022-03-30T07:10:59.000Z | import cv2
import numpy as np
from drivers.devices.kinect_azure.pykinectazure import PyKinectAzure, _k4a
mtx = np.array([[610.16101074, 0, 638.35681152], [0, 610.19384766, 367.82455444], [0, 0, 1]])
def get_images(pk_obj):
while True:
pk_obj.device_get_capture()
color_image_handle = pk_obj.captur... | 36.545455 | 97 | 0.678275 | import cv2
import numpy as np
from drivers.devices.kinect_azure.pykinectazure import PyKinectAzure, _k4a
mtx = np.array([[610.16101074, 0, 638.35681152], [0, 610.19384766, 367.82455444], [0, 0, 1]])
def get_images(pk_obj):
while True:
pk_obj.device_get_capture()
color_image_handle = pk_obj.captur... | true | true |
f758bbd75b6b853d023482dcad85fedece201425 | 3,126 | py | Python | torch_geometric/read/planetoid.py | cysmnl/geometric_cognition | 473c0cf585aaf49904bfb87c35ea706e12f67f8a | [
"MIT"
] | 62 | 2018-12-12T16:06:34.000Z | 2022-02-18T11:32:04.000Z | torch_geometric/read/planetoid.py | cysmnl/geometric_cognition | 473c0cf585aaf49904bfb87c35ea706e12f67f8a | [
"MIT"
] | 2 | 2019-12-26T12:51:47.000Z | 2020-09-02T10:39:55.000Z | torch_geometric/read/planetoid.py | cysmnl/geometric_cognition | 473c0cf585aaf49904bfb87c35ea706e12f67f8a | [
"MIT"
] | 19 | 2018-12-12T17:51:43.000Z | 2021-09-19T08:01:29.000Z | import sys
import os.path as osp
from itertools import repeat
import torch
from torch_sparse import coalesce
from torch_geometric.data import Data
from torch_geometric.read import read_txt_array
from torch_geometric.utils import remove_self_loops
try:
import cPickle as pickle
except ImportError:
import pickle... | 31.897959 | 78 | 0.659309 | import sys
import os.path as osp
from itertools import repeat
import torch
from torch_sparse import coalesce
from torch_geometric.data import Data
from torch_geometric.read import read_txt_array
from torch_geometric.utils import remove_self_loops
try:
import cPickle as pickle
except ImportError:
import pickle... | true | true |
f758bc7b48af6cfeca955b9a2b428070838d6162 | 1,219 | py | Python | lib2/Sticker.py | Dularazero/chappie-bot | dad5a5ad886fbcba289015282618fa902d358db6 | [
"MIT"
] | 37 | 2020-10-05T17:12:02.000Z | 2022-03-07T14:53:35.000Z | lib2/Sticker.py | INIDboyzz/Juliana | b768e7d4aa13eb1a97e8d8df7e331b99b8b082fb | [
"MIT"
] | 24 | 2020-10-08T15:56:18.000Z | 2022-03-15T00:16:25.000Z | lib2/Sticker.py | INIDboyzz/Juliana | b768e7d4aa13eb1a97e8d8df7e331b99b8b082fb | [
"MIT"
] | 44 | 2020-10-10T12:58:24.000Z | 2022-02-09T13:58:01.000Z | import requests
from lib2 import upload
from setting import server
import time
def stickerSave(user, name, url):
save=requests.get(f"{server}/uploadSticker", params={"pengguna":user[:-5], "nama":name, "konten":upload(url).get("id")}).json()
print(save)
if save.get("status") == False and save.get("tersimpan"... | 38.09375 | 131 | 0.632486 | import requests
from lib2 import upload
from setting import server
import time
def stickerSave(user, name, url):
save=requests.get(f"{server}/uploadSticker", params={"pengguna":user[:-5], "nama":name, "konten":upload(url).get("id")}).json()
print(save)
if save.get("status") == False and save.get("tersimpan"... | true | true |
f758bcf7ed0d9b65199c986db84e5c2c71c65be2 | 3,588 | py | Python | embedders/FSTH.py | lichnost/latent-pose-reenactment | ee2719355f1db3d0b927f9b10b0d42d1fd07d4c9 | [
"Apache-2.0"
] | 103 | 2020-10-28T10:35:39.000Z | 2022-03-21T12:58:27.000Z | embedders/FSTH.py | lichnost/latent-pose-reenactment | ee2719355f1db3d0b927f9b10b0d42d1fd07d4c9 | [
"Apache-2.0"
] | 37 | 2020-10-29T02:32:28.000Z | 2022-02-26T16:06:55.000Z | embedders/FSTH.py | lichnost/latent-pose-reenactment | ee2719355f1db3d0b927f9b10b0d42d1fd07d4c9 | [
"Apache-2.0"
] | 26 | 2020-11-05T12:42:01.000Z | 2022-02-11T08:59:52.000Z | import torch
from torch import nn
from torch.nn.utils import spectral_norm
from generators.common import blocks
class Wrapper:
@staticmethod
def get_args(parser):
parser.add('--embed_padding', type=str, default='zero', help='zero|reflection')
parser.add('--embed_num_blocks', type=int, default=6... | 35.524752 | 106 | 0.615106 | import torch
from torch import nn
from torch.nn.utils import spectral_norm
from generators.common import blocks
class Wrapper:
@staticmethod
def get_args(parser):
parser.add('--embed_padding', type=str, default='zero', help='zero|reflection')
parser.add('--embed_num_blocks', type=int, default=6... | true | true |
f758bdae6809cac951b9b3b6a9a82ca2aa2493ba | 621 | py | Python | pico_module/deprecated/autorun.py | ncsurobotics/acoustics-sw7 | 89bda1eac46518e5ef5f8c059821df37fc2596c5 | [
"MIT"
] | null | null | null | pico_module/deprecated/autorun.py | ncsurobotics/acoustics-sw7 | 89bda1eac46518e5ef5f8c059821df37fc2596c5 | [
"MIT"
] | 6 | 2018-09-08T15:03:27.000Z | 2018-09-22T15:00:21.000Z | pico_module/deprecated/autorun.py | ncsurobotics/acoustics-sw7 | 89bda1eac46518e5ef5f8c059821df37fc2596c5 | [
"MIT"
] | 2 | 2018-09-26T18:34:17.000Z | 2019-01-11T00:44:19.000Z | import pico_module as pm
import csv
import matplotlib.pyplot as plt
import signal
import sys
handle = 0
def signal_handler(signal, frame):
print "Stopping...\n"
if ( handle != 0 ):
pm.pico_close(handle);
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
handle = pm.pico_init(1)
i = 0
while (True):
... | 20.7 | 69 | 0.663446 | import pico_module as pm
import csv
import matplotlib.pyplot as plt
import signal
import sys
handle = 0
def signal_handler(signal, frame):
print "Stopping...\n"
if ( handle != 0 ):
pm.pico_close(handle);
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
handle = pm.pico_init(1)
i = 0
while (True):
... | false | true |
f758bdf15b5111f612a497537c1ae9394f7696f6 | 2,341 | py | Python | inbc-program/inbc/inbc.py | ahameedx/intel-inb-manageability | aca445fa4cef0b608e6e88e74476547e10c06073 | [
"Apache-2.0"
] | 5 | 2021-12-13T21:19:31.000Z | 2022-01-18T18:29:43.000Z | inbc-program/inbc/inbc.py | ahameedx/intel-inb-manageability | aca445fa4cef0b608e6e88e74476547e10c06073 | [
"Apache-2.0"
] | 45 | 2021-12-30T17:21:09.000Z | 2022-03-29T22:47:32.000Z | inbc-program/inbc/inbc.py | ahameedx/intel-inb-manageability | aca445fa4cef0b608e6e88e74476547e10c06073 | [
"Apache-2.0"
] | 4 | 2022-01-26T17:42:54.000Z | 2022-03-30T04:48:04.000Z | """Command-line INBC tool to invoke Software update on the device with manageability framework.
Copyright (C) 2020-2022 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import logging
import sys
import signal
import itertools
from typing import Any
from time import sleep
from inbc import shared
from inbc.bro... | 29.2625 | 95 | 0.673217 |
import logging
import sys
import signal
import itertools
from typing import Any
from time import sleep
from inbc import shared
from inbc.broker import Broker
from inbc.parser import ArgsParser
from inbc.inbc_exception import InbcException, InbcCode
from inbc.xlink_checker import XlinkChecker
from inbm_vision_lib.requ... | true | true |
f758bf18673d40754d773cb1a2d9ff6569047826 | 969 | py | Python | python/en/_matplotlib/gallery/text_labels_and_annotations/auto-wrapping_text.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/text_labels_and_annotations/auto-wrapping_text.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | python/en/_matplotlib/gallery/text_labels_and_annotations/auto-wrapping_text.py | aimldl/coding | 70ddbfaa454ab92fd072ee8dc614ecc330b34a70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
text_labels_and_annotations/auto-wrapping_text.py
Matplotlib > Gallery > Text, labels and annotations> Auto-wrapping text
https://matplotlib.org/3.1.1/gallery/text_labels_and_annotations/autowrap.html#sphx-glr-gallery-text-labels-and-annotations-autowrap-py
"""
import... | 38.76 | 135 | 0.686275 |
import matplotlib.pyplot as plt
fig = plt.figure()
plt.axis([0, 10, 0, 10])
t = ("This is a really long string that I'd rather have wrapped so that it "
"doesn't go outside of the figure, but if it's long enough it will go "
"off the top or bottom!")
plt.text(4, 1, t, ha='left', rotation=15, wrap=True)
plt.... | true | true |
f758bf27be5fccf1d91dc4799c65e0c53021e044 | 9,506 | py | Python | sdk/python/pulumi_azure_native/insights/v20191017preview/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/insights/v20191017preview/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/insights/v20191017preview/outputs.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 33.121951 | 162 | 0.639175 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
__all__ = [
'PrivateEndpointConnectionResponse',
'PrivateEndpointPropertyResponse',
'PrivateLinkServiceConnectionStatePropertyResponse',
... | true | true |
f758bf4834acb13fea46b8d7fd536f49da4b64aa | 2,742 | py | Python | model_build.py | geetakumri/Moview_Review_Sentiment_Analysis | 41f4c17d9115633b000f52268ac768cfe013e808 | [
"MIT"
] | null | null | null | model_build.py | geetakumri/Moview_Review_Sentiment_Analysis | 41f4c17d9115633b000f52268ac768cfe013e808 | [
"MIT"
] | null | null | null | model_build.py | geetakumri/Moview_Review_Sentiment_Analysis | 41f4c17d9115633b000f52268ac768cfe013e808 | [
"MIT"
] | null | null | null | from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer, TfidfTransformer, CountVectorizer
from sklearn import svm
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import roc_auc_score
from sklearn.pipeline import Pipeline
fr... | 36.56 | 154 | 0.719912 | from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.feature_extraction.text import TfidfVectorizer, TfidfTransformer, CountVectorizer
from sklearn import svm
from sklearn.naive_bayes import MultinomialNB
from sklearn.metrics import roc_auc_score
from sklearn.pipeline import Pipeline
fr... | true | true |
f758c067f31011c0d79434874f7bf50c5bdd1308 | 12,485 | py | Python | test/vpp_ip_route.py | leecoool/fdio-vpp | 694396dc589b4fe75b1fad02fde1d3c3cdaeef04 | [
"Apache-2.0"
] | null | null | null | test/vpp_ip_route.py | leecoool/fdio-vpp | 694396dc589b4fe75b1fad02fde1d3c3cdaeef04 | [
"Apache-2.0"
] | null | null | null | test/vpp_ip_route.py | leecoool/fdio-vpp | 694396dc589b4fe75b1fad02fde1d3c3cdaeef04 | [
"Apache-2.0"
] | null | null | null | """
IP Routes
object abstractions for representing IP routes in VPP
"""
import socket
from vpp_object import *
# from vnet/vnet/mpls/mpls_types.h
MPLS_IETF_MAX_LABEL = 0xfffff
MPLS_LABEL_INVALID = MPLS_IETF_MAX_LABEL + 1
class VppRoutePath(object):
def __init__(
self,
nh_addr,
... | 35.979827 | 73 | 0.48322 |
import socket
from vpp_object import *
MPLS_IETF_MAX_LABEL = 0xfffff
MPLS_LABEL_INVALID = MPLS_IETF_MAX_LABEL + 1
class VppRoutePath(object):
def __init__(
self,
nh_addr,
nh_sw_if_index,
nh_table_id=0,
labels=[],
nh_via_label=MPLS_LABEL_IN... | true | true |
f758c1810cbfcd504a8a920a485a6e9e69db12e3 | 3,635 | py | Python | setup.py | faio/ibptws | dc9e6d66cb67005986abf2003aebfa66e2cec1ba | [
"Apache-2.0"
] | 10 | 2015-09-16T16:54:52.000Z | 2017-10-12T17:59:14.000Z | setup.py | faio/ibptws | dc9e6d66cb67005986abf2003aebfa66e2cec1ba | [
"Apache-2.0"
] | null | null | null | setup.py | faio/ibptws | dc9e6d66cb67005986abf2003aebfa66e2cec1ba | [
"Apache-2.0"
] | 10 | 2015-09-16T10:50:19.000Z | 2020-05-06T11:32:55.000Z | # -*- coding: utf-8 -*-
#
# setup.py
#
# Copyright 2015 Base4 Sistemas Ltda ME
#
# 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 re... | 31.336207 | 79 | 0.594773 |
import codecs
import io
import os
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('sep', os.linesep)
buf = []
for filename in filenames:
with ... | true | true |
f758c34b3e3a98219b8c7bf010d21cbc6d4f300e | 5,779 | py | Python | diadem/align.py | wfondrie/diadem | cf42449ccd305b7fd040f9b03129256f60f13949 | [
"Apache-2.0"
] | 2 | 2019-11-21T12:34:31.000Z | 2021-02-22T05:10:22.000Z | diadem/align.py | wfondrie/diadem | cf42449ccd305b7fd040f9b03129256f60f13949 | [
"Apache-2.0"
] | null | null | null | diadem/align.py | wfondrie/diadem | cf42449ccd305b7fd040f9b03129256f60f13949 | [
"Apache-2.0"
] | null | null | null | """
This module contains the my implementation of the FastDTW algorithm.
The algorithm is described in http://cs.fit.edu/~pkc/papers/tdm04.pdf.
This implementation is losely based on the python package from this
GitHub repository: https://github.com/slaypni/fastdtw.
My code deviates from this repository is a few ways... | 34.60479 | 82 | 0.596124 | from typing import Tuple, Callable
import numpy as np
import numba as nb
@nb.njit
def cosine_distance(x, y, tiny=np.finfo(float).tiny):
denom = (np.linalg.norm(x) * np.linalg.norm(y) + tiny)
return 1 - np.dot(x, y) / denom
def fastdtw(x: np.ndarray, y: np.ndarray, radius: int = 1,
dist: Callable... | true | true |
f758c4028a7bb399086c6f515e16fdd210117147 | 14,922 | py | Python | ucscsdk/mometa/testing/TestingServiceProfileFsm.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/testing/TestingServiceProfileFsm.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/testing/TestingServiceProfileFsm.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for TestingServiceProfileFsm ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class TestingServiceProfileFsmConsts():
COMPLETION_TIME_ = ""
CURRENT_FSM_RESO... | 86.254335 | 2,721 | 0.752781 |
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class TestingServiceProfileFsmConsts():
COMPLETION_TIME_ = ""
CURRENT_FSM_RESOLVE_MANY_POLICY_FSM = "ResolveManyPolicyFsm"
CURRENT_FSM_RESOLVE_POLICY_FSM = "ResolvePolic... | true | true |
f758c75f2b093046d2c0a61bf49806d0c6d30f3a | 6,168 | py | Python | AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-13T00:01:12.000Z | 2021-09-13T00:01:12.000Z | AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/physics/C5296614_PhysXMaterial_ColliderShape.py | aaarsene/o3de | 37e3b0226958974defd14dd6d808e8557dcd7345 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-07-20T11:07:25.000Z | 2021-07-20T11:07:25.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test case ID : C5296614
# Test Case Title : Check that unless you assign a shape to a physX collider compone... | 38.792453 | 155 | 0.683366 |
class Tests:
enter_game_mode = ("Entered game mode", "Failed to enter game mode")
exit_game_mode = ("Exited game mode", "Couldn't exit game mode")
collider_1_found = ("collider_1 was found", "collider_1 was not found")
collider_2_found = ("collider_... | true | true |
f758c77b931a16b4128f02a73f99a72e3a282871 | 9,340 | py | Python | plot_lib/snow_plot.py | tclarkin/shread_dash | a45e2f2946c74526e69c087587676aaa4cb15fba | [
"CC0-1.0"
] | null | null | null | plot_lib/snow_plot.py | tclarkin/shread_dash | a45e2f2946c74526e69c087587676aaa4cb15fba | [
"CC0-1.0"
] | null | null | null | plot_lib/snow_plot.py | tclarkin/shread_dash | a45e2f2946c74526e69c087587676aaa4cb15fba | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 27, 2022
SHREAD Dash Snow Plot
Script for running the snow plot in the dashboard (shread_dash.py)
@author: buriona, tclarkin (2020-2022)
"""
import pandas as pd
import numpy as np
import plotly.graph_objects as go
from plot_lib.utils import import_snotel,import_csas_l... | 31.661017 | 118 | 0.54015 |
import pandas as pd
import numpy as np
import plotly.graph_objects as go
from plot_lib.utils import import_snotel,import_csas_live
from database import snotel_sites
from database import csas_gages
from plot_lib.utils import screen_spatial,ba_stats_all,ba_stats_std,screen_csas,screen_snotel
from plot_lib.utils import ... | true | true |
f758c7f6537fbb8fe57f7d960b91163b1684542f | 414 | py | Python | implore/contact.py | skeptycal/implore | 18035c13b94e9277658d07baaaa519b41513f1d5 | [
"MIT",
"Unlicense"
] | null | null | null | implore/contact.py | skeptycal/implore | 18035c13b94e9277658d07baaaa519b41513f1d5 | [
"MIT",
"Unlicense"
] | null | null | null | implore/contact.py | skeptycal/implore | 18035c13b94e9277658d07baaaa519b41513f1d5 | [
"MIT",
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
""" Part of the `AutoSys` package
copyright (c) 2019 Michael Treanor
https://www.github.com/skeptycal/autosys
https://www.twitter.com/skeptycal
`AutoSys` is licensed under the `MIT License
`<https://opensource.org/licenses/MIT>`
"""
__license__ = "MIT"
... | 25.875 | 58 | 0.625604 | __license__ = "MIT"
class Contact_List(list):
pass
| true | true |
f758c8125d9872f5ac97f9d244c326b22d4a8bd0 | 4,356 | py | Python | nnfs/model.py | tblut/NNFS | 75320c546043bc74f368a7a6edcd8bb70aa90dc4 | [
"MIT"
] | null | null | null | nnfs/model.py | tblut/NNFS | 75320c546043bc74f368a7a6edcd8bb70aa90dc4 | [
"MIT"
] | null | null | null | nnfs/model.py | tblut/NNFS | 75320c546043bc74f368a7a6edcd8bb70aa90dc4 | [
"MIT"
] | null | null | null | import numpy as np
from nnfs.layers import Linear
from nnfs.optimizers import SGD
class Model:
def __init__(self, layers, loss, optimizer=SGD(lr=0.01)):
self.layers = layers
self.loss = loss
self.optimizer = optimizer
def save_weights(self, filename):
weights = []
for ... | 41.884615 | 104 | 0.533976 | import numpy as np
from nnfs.layers import Linear
from nnfs.optimizers import SGD
class Model:
def __init__(self, layers, loss, optimizer=SGD(lr=0.01)):
self.layers = layers
self.loss = loss
self.optimizer = optimizer
def save_weights(self, filename):
weights = []
for ... | true | true |
f758c812b2de52a52e992a1798de379a959b6b41 | 2,235 | py | Python | demoDay25_CNNAndWord2Vec/boston_multi.py | mozhumz/machine_learning_py | 880f6778ac16b0a16a80b31972a35304caa91dc1 | [
"MulanPSL-1.0"
] | null | null | null | demoDay25_CNNAndWord2Vec/boston_multi.py | mozhumz/machine_learning_py | 880f6778ac16b0a16a80b31972a35304caa91dc1 | [
"MulanPSL-1.0"
] | null | null | null | demoDay25_CNNAndWord2Vec/boston_multi.py | mozhumz/machine_learning_py | 880f6778ac16b0a16a80b31972a35304caa91dc1 | [
"MulanPSL-1.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
#加载数据集
boston_housing = tf.keras.datasets.boston_housing
(train_x,train_y),(test_x,test_y) = boston_housing.load_data()
num_train=len(train_x) #训练集和测试机中样本的数量
num_test=len(test_x)
#对训练样本和测试样本进行标准化(归一化),这里有用到张量的广播运算机制
x_train=(train_x-train_x... | 26.294118 | 79 | 0.717673 | import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
boston_housing = tf.keras.datasets.boston_housing
(train_x,train_y),(test_x,test_y) = boston_housing.load_data()
num_train=len(train_x) num_test=len(test_x)
x_train=(train_x-train_x.min(axis=0))/(train_x.max(axis=0)-train_x.min(axis=0))
y_t... | true | true |
f758c89b34e2136b01c75ec0ab234101ab7a6120 | 2,508 | py | Python | zenml/components/bulk_inferrer/utils.py | ramitsurana/zenml | 6994ea7ec0a38e9495306d55c3069107cdd5e65f | [
"Apache-2.0"
] | 1 | 2021-08-13T03:07:53.000Z | 2021-08-13T03:07:53.000Z | zenml/components/bulk_inferrer/utils.py | ramitsurana/zenml | 6994ea7ec0a38e9495306d55c3069107cdd5e65f | [
"Apache-2.0"
] | null | null | null | zenml/components/bulk_inferrer/utils.py | ramitsurana/zenml | 6994ea7ec0a38e9495306d55c3069107cdd5e65f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) maiot GmbH 2021. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38 | 74 | 0.685805 |
from typing import Any, Text, Union, Dict
import tensorflow as tf
from tensorflow_serving.apis import prediction_log_pb2
from tfx.components.bulk_inferrer.prediction_to_example_utils import \
convert
from tfx.proto import bulk_inferrer_pb2
_OutputExampleSpecType = Union[bulk_inferrer_pb2.OutputExampleSpec, Any]
... | true | true |
f758c9c3c59b2323ce863aa66f0ffa57f7ffe669 | 1,709 | py | Python | for_imagenet/make_df_imagenet.py | tak-sakumoto/formatomato | 4713338135b2ac3960cc2f9a6f017199853cdc52 | [
"MIT"
] | null | null | null | for_imagenet/make_df_imagenet.py | tak-sakumoto/formatomato | 4713338135b2ac3960cc2f9a6f017199853cdc52 | [
"MIT"
] | null | null | null | for_imagenet/make_df_imagenet.py | tak-sakumoto/formatomato | 4713338135b2ac3960cc2f9a6f017199853cdc52 | [
"MIT"
] | null | null | null | import pandas as pd
from PIL import Image
from pathlib import Path
def make_df_imagenet(dataset):
"""
Making Pandas Dataframes of the extracted data
"""
# Making lists of class columns
classes = list(Path(dataset).iterdir())
classes = [p.stem for p in classes if p.is_dir()]
class_ids = [i f... | 24.768116 | 69 | 0.613224 | import pandas as pd
from PIL import Image
from pathlib import Path
def make_df_imagenet(dataset):
classes = list(Path(dataset).iterdir())
classes = [p.stem for p in classes if p.is_dir()]
class_ids = [i for i in range(len(classes))]
class_df_dict = {
'CLASS_ID': class_ids,
'CLASS':... | true | true |
f758c9c6f47d64357d55da2214cc499caa8c0026 | 1,081 | py | Python | onlinecourse/urls.py | orchestrationAPI/final-cloud-app-with-database | 42e2fe38113c5d37b1c5edae0ddb6d0db5b1ea30 | [
"Apache-2.0"
] | null | null | null | onlinecourse/urls.py | orchestrationAPI/final-cloud-app-with-database | 42e2fe38113c5d37b1c5edae0ddb6d0db5b1ea30 | [
"Apache-2.0"
] | null | null | null | onlinecourse/urls.py | orchestrationAPI/final-cloud-app-with-database | 42e2fe38113c5d37b1c5edae0ddb6d0db5b1ea30 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
app_name = 'onlinecourse'
urlpatterns = [
# route is a string contains a URL pattern
# view refers to the view function
# name the URL
path(route='', view=views.CourseListView.as... | 41.576923 | 121 | 0.708603 | from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
app_name = 'onlinecourse'
urlpatterns = [
path(route='', view=views.CourseListView.as_view(), name='index'),
path('registration/', views.registration_request, name='registrat... | true | true |
f758cb9a6d192d01147b286a1651a541028a6fab | 4,502 | py | Python | benchmark/startQiskit_noisy3345.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy3345.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy3345.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=49
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 35.448819 | 140 | 0.656375 | import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
impo... | true | true |
f758cc81eabe60a36359e034a4e1cc90d2e7f6e1 | 2,517 | pyw | Python | 20210214/main.pyw | TianqiVirus/tivsEssay | 8b40d6a1ef1e292b1bab90ad0a3309cbf3441128 | [
"BSD-2-Clause"
] | null | null | null | 20210214/main.pyw | TianqiVirus/tivsEssay | 8b40d6a1ef1e292b1bab90ad0a3309cbf3441128 | [
"BSD-2-Clause"
] | null | null | null | 20210214/main.pyw | TianqiVirus/tivsEssay | 8b40d6a1ef1e292b1bab90ad0a3309cbf3441128 | [
"BSD-2-Clause"
] | null | null | null | # tianqiVirus's Essay
# by TianqiVirus
# https://github.com/TianqiVirus
# Released under a "Simplified BSD" license
width=600
height=600
title="tianqiVirusEssay"
icon="clown.ico"
fps=32
import pygame
from random import randint
screen = pygame.display.set_mode([width,height])
pygame.display.set_caption... | 24.436893 | 93 | 0.681764 | # by TianqiVirus
# https://github.com/TianqiVirus
# Released under a "Simplified BSD" license
width=600
height=600
title="tianqiVirusEssay"
icon="clown.ico"
fps=32
import pygame
from random import randint
screen = pygame.display.set_mode([width,height])
pygame.display.set_caption(title)
pygame.display... | true | true |
f758ccb8fecb22b8d8a0bb7353808f478905ae94 | 3,501 | py | Python | qiskit_machine_learning/algorithms/distribution_learners/qgan/discriminative_network.py | FrankFeenix/qiskit-machine-learning | ec800bc8a58b32f3052ff399d54f19a74417fc7d | [
"Apache-2.0"
] | null | null | null | qiskit_machine_learning/algorithms/distribution_learners/qgan/discriminative_network.py | FrankFeenix/qiskit-machine-learning | ec800bc8a58b32f3052ff399d54f19a74417fc7d | [
"Apache-2.0"
] | null | null | null | qiskit_machine_learning/algorithms/distribution_learners/qgan/discriminative_network.py | FrankFeenix/qiskit-machine-learning | ec800bc8a58b32f3052ff399d54f19a74417fc7d | [
"Apache-2.0"
] | 1 | 2021-06-15T16:41:39.000Z | 2021-06-15T16:41:39.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 27.785714 | 87 | 0.624107 |
from typing import List, Iterable, Optional, Dict
from abc import ABC, abstractmethod
import numpy as np
from qiskit.utils import QuantumInstance
class DiscriminativeNetwork(ABC):
@abstractmethod
def __init__(self) -> None:
super().__init__()
self._num_parameters = 0
self._num_qub... | true | true |
f758ccecb26bc6bdc1ca4f2959fcaa71cc65c5bc | 13,137 | py | Python | electrum_xazab/plugins/hw_wallet/qt.py | nunumichael/electrum-xazab | f128c765f451b418a418f9cd8b8e24fd8f66df74 | [
"MIT"
] | null | null | null | electrum_xazab/plugins/hw_wallet/qt.py | nunumichael/electrum-xazab | f128c765f451b418a418f9cd8b8e24fd8f66df74 | [
"MIT"
] | null | null | null | electrum_xazab/plugins/hw_wallet/qt.py | nunumichael/electrum-xazab | f128c765f451b418a418f9cd8b8e24fd8f66df74 | [
"MIT"
] | 2 | 2021-05-23T23:38:56.000Z | 2021-05-24T19:01:07.000Z | #!/usr/bin/env python3
# -*- mode: python -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2016 The Electrum developers
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without... | 41.971246 | 115 | 0.649463 |
import threading
from functools import partial
from typing import TYPE_CHECKING, Union, Optional, Callable, Any
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QVBoxLayout, QLineEdit, QHBoxLayout, QLabel
from electrum_xazab.gui.qt.password_dialog import PasswordLayout, PW_PASSPHRASE
from ele... | true | true |
f758cdf9ab64b6534c4f2a7376f27a69cf0356f9 | 3,463 | py | Python | setup.py | dprelipcean/reana-workflow-engine-yadage | adb65a9166603e9e08b870fd945932cc4def45db | [
"MIT"
] | null | null | null | setup.py | dprelipcean/reana-workflow-engine-yadage | adb65a9166603e9e08b870fd945932cc4def45db | [
"MIT"
] | null | null | null | setup.py | dprelipcean/reana-workflow-engine-yadage | adb65a9166603e9e08b870fd945932cc4def45db | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of REANA.
# Copyright (C) 2017, 2018, 2019 CERN.
#
# REANA is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""REANA-Workflow-Engine-Yadage."""
from __future__ import absolute_import, print... | 30.377193 | 79 | 0.630956 |
from __future__ import absolute_import, print_function
import os
import re
from setuptools import find_packages, setup
readme = open('README.rst').read()
history = open('CHANGES.rst').read()
tests_require = [
'pytest-reana>=0.6.0.dev20190705,<0.7.0',
]
extras_require = {
'docs': [
'Sphinx>=1.4.4'... | true | true |
f758ced5a2bb541850827028d347ba02ae8f2e33 | 1,351 | py | Python | nicos_mlz/sans1/setups/pilz.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | nicos_mlz/sans1/setups/pilz.py | ebadkamil/nicos | 0355a970d627aae170c93292f08f95759c97f3b5 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-08-18T10:55:42.000Z | 2021-08-18T10:55:42.000Z | nicos_mlz/sans1/setups/pilz.py | ISISComputingGroup/nicos | 94cb4d172815919481f8c6ee686f21ebb76f2068 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | null | null | null | description = 'Inputs from the Pilz control box'
group = 'lowlevel'
tango_base = 'tango://sans1hw.sans1.frm2:10000/sans1/modbus/'
# TODO: Mapping and description of the devices
devices = dict(
iatt1 = device('nicos.devices.tango.NamedDigitalInput',
description = 'Unknown',
tangodevice = tango_ba... | 31.418605 | 62 | 0.635085 | description = 'Inputs from the Pilz control box'
group = 'lowlevel'
tango_base = 'tango://sans1hw.sans1.frm2:10000/sans1/modbus/'
devices = dict(
iatt1 = device('nicos.devices.tango.NamedDigitalInput',
description = 'Unknown',
tangodevice = tango_base + 'iatt1',
),
iatt2 = device('nicos.... | true | true |
f758cf368c74b6ec1b4ea19fa0cfc201e3ffd830 | 2,503 | py | Python | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_parts/tests/test_model_part.py | piyushka17/azure-intelligent-edge-patterns | 0d088899afb0022daa2ac434226824dba2c997c1 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_parts/tests/test_model_part.py | piyushka17/azure-intelligent-edge-patterns | 0d088899afb0022daa2ac434226824dba2c997c1 | [
"MIT"
] | null | null | null | factory-ai-vision/EdgeSolution/modules/WebModule/backend/vision_on_edge/azure_parts/tests/test_model_part.py | piyushka17/azure-intelligent-edge-patterns | 0d088899afb0022daa2ac434226824dba2c997c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Azure Part Models testcases.
"""
from django.core.exceptions import MultipleObjectsReturned
from vision_on_edge.general.tests.azure_testcase import CustomVisionTestCase
from vision_on_edge.general.tests.test_special_strings import special_strings
from ..models import Part
class AzurePart... | 33.824324 | 77 | 0.586896 |
from django.core.exceptions import MultipleObjectsReturned
from vision_on_edge.general.tests.azure_testcase import CustomVisionTestCase
from vision_on_edge.general.tests.test_special_strings import special_strings
from ..models import Part
class AzurePartTestCase(CustomVisionTestCase):
def setUp(self):
... | true | true |
f758cf3d75ba605c8419a62c914609cc61f63dad | 3,731 | py | Python | pybelsberg/namespace.py | babelsberg/pybelsberg | 531998655d9b7a4a3ac1ecdbf5c6ef6c356c8deb | [
"BSD-3-Clause"
] | 6 | 2015-12-07T14:41:28.000Z | 2021-09-15T13:45:59.000Z | pybelsberg/namespace.py | Pybelsberg/pybelsberg | 80c6ad8f56cfbe9c593280c51eae649ff7ef150e | [
"BSD-3-Clause"
] | null | null | null | pybelsberg/namespace.py | Pybelsberg/pybelsberg | 80c6ad8f56cfbe9c593280c51eae649ff7ef150e | [
"BSD-3-Clause"
] | 2 | 2016-05-21T05:50:54.000Z | 2019-11-13T08:31:42.000Z | import functools
import z3
class WrappingNamespace(dict):
"""A namespace that automatically wraps all objects that are looked up on
it with magic substitutes for the getattr/setattr protocols.
:type constraints: pybelsberg.constraint.Constraints
:var patches: A mapping of all instance attributes to th... | 37.31 | 77 | 0.569016 | import functools
import z3
class WrappingNamespace(dict):
def __init__(self, constraints, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
self.constraints = constraints
self.patches = {}
def __getitem__(self, key):
if key == '__tracebackhide__': return False... | true | true |
f758cf6c37622d53fc782eb99c355f17d7963b42 | 128 | py | Python | Darlington/phase1/python Basic 1/day 14 solution/qtn8.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | Darlington/phase1/python Basic 1/day 14 solution/qtn8.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | Darlington/phase1/python Basic 1/day 14 solution/qtn8.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z | #program to check whether lowercase letters exist in a string.
str1 = 'A8238i823acdeOUEI'
print(any(c.islower() for c in str1))
| 32 | 62 | 0.765625 | str1 = 'A8238i823acdeOUEI'
print(any(c.islower() for c in str1))
| true | true |
f758cf76d05e2f9deab3c71b3575e3b9b67644bb | 6,888 | py | Python | tools/heap.py | Melab/gvmt | 566eac01724b687bc5e11317e44230faab15f895 | [
"MIT"
] | null | null | null | tools/heap.py | Melab/gvmt | 566eac01724b687bc5e11317e44230faab15f895 | [
"MIT"
] | null | null | null | tools/heap.py | Melab/gvmt | 566eac01724b687bc5e11317e44230faab15f895 | [
"MIT"
] | 1 | 2021-12-04T15:59:58.000Z | 2021-12-04T15:59:58.000Z |
import os, common, gtypes, sys_compiler, gvmtlink, heap
_ptr_size = gtypes.p.size
_ptr_mask = _ptr_size - 1
ADDR_TEMPLATE = '.long %s\n'
ALIGN_TEMPLATE = '.align %s\n'
LINE_SIZE = 1 << 7
BLOCK_SIZE = 1 << 14
SUPER_BLOCK_ALIGN = 1 << 19
LINE_MASK = LINE_SIZE - 1
BLOCK_MASK = BLOCK_SIZE - 1
BLOCKS_PER_SUPER_BLOCK =... | 30.887892 | 92 | 0.563444 |
import os, common, gtypes, sys_compiler, gvmtlink, heap
_ptr_size = gtypes.p.size
_ptr_mask = _ptr_size - 1
ADDR_TEMPLATE = '.long %s\n'
ALIGN_TEMPLATE = '.align %s\n'
LINE_SIZE = 1 << 7
BLOCK_SIZE = 1 << 14
SUPER_BLOCK_ALIGN = 1 << 19
LINE_MASK = LINE_SIZE - 1
BLOCK_MASK = BLOCK_SIZE - 1
BLOCKS_PER_SUPER_BLOCK =... | true | true |
f758d08963292997742c43fed979119c28723640 | 15,704 | py | Python | src/hiss/handler/gntp/message.py | sffjunkie/hiss | ef4eb33d840b948f2e83efe112014f06dd687952 | [
"Apache-2.0"
] | 1 | 2019-03-21T09:50:09.000Z | 2019-03-21T09:50:09.000Z | src/hiss/handler/gntp/message.py | sffjunkie/hiss | ef4eb33d840b948f2e83efe112014f06dd687952 | [
"Apache-2.0"
] | null | null | null | src/hiss/handler/gntp/message.py | sffjunkie/hiss | ef4eb33d840b948f2e83efe112014f06dd687952 | [
"Apache-2.0"
] | null | null | null | import logging
import re
from binascii import unhexlify
from datetime import datetime
from os import urandom
from urllib.parse import urlparse
from hiss.encryption import PY_CRYPTO, encrypt, decrypt
from hiss.exception import MarshalError
from hiss.handler.gntp import GNTP_BASE_VERSION, ENCRYPTION_ALGORITHM
from hiss.... | 36.267898 | 223 | 0.546931 | import logging
import re
from binascii import unhexlify
from datetime import datetime
from os import urandom
from urllib.parse import urlparse
from hiss.encryption import PY_CRYPTO, encrypt, decrypt
from hiss.exception import MarshalError
from hiss.handler.gntp import GNTP_BASE_VERSION, ENCRYPTION_ALGORITHM
from hiss.... | true | true |
f758d16798393dfb15decddc237313befa8e9065 | 410 | py | Python | utility.py | cyber-meow/Robotic_state_repr_learning | d74fe372bea0b1cf42107450a8c3344a99279e91 | [
"MIT"
] | null | null | null | utility.py | cyber-meow/Robotic_state_repr_learning | d74fe372bea0b1cf42107450a8c3344a99279e91 | [
"MIT"
] | null | null | null | utility.py | cyber-meow/Robotic_state_repr_learning | d74fe372bea0b1cf42107450a8c3344a99279e91 | [
"MIT"
] | null | null | null |
"""
Utility functions
"""
import numpy as np
def set_all_args(obj, argdict):
for k in argdict.keys():
if hasattr(obj, k):
setattr(obj, k, argdict[k])
else:
print("Warning: parameter name {} not found!".format(k))
def div0(a,b):
with np.errstate(divide='ignore', inval... | 18.636364 | 68 | 0.570732 |
import numpy as np
def set_all_args(obj, argdict):
for k in argdict.keys():
if hasattr(obj, k):
setattr(obj, k, argdict[k])
else:
print("Warning: parameter name {} not found!".format(k))
def div0(a,b):
with np.errstate(divide='ignore', invalid='ignore'):
c = ... | true | true |
f758d1b0e0c3fd0f5a4dd3a259335c9dbc50c4f3 | 10,553 | py | Python | mgan.py | yashbonde/GAN-textures | 7e9bfa61c474f17812bad2430e63a2383ac85067 | [
"MIT"
] | 1 | 2020-09-06T13:24:22.000Z | 2020-09-06T13:24:22.000Z | mgan.py | yashbonde/GAN-textures | 7e9bfa61c474f17812bad2430e63a2383ac85067 | [
"MIT"
] | null | null | null | mgan.py | yashbonde/GAN-textures | 7e9bfa61c474f17812bad2430e63a2383ac85067 | [
"MIT"
] | null | null | null |
import os
import time
import random
import argparse
import numpy as np
from tqdm import trange
from types import SimpleNamespace
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision.utils import save_image
from ... | 38.097473 | 118 | 0.614517 |
import os
import time
import random
import argparse
import numpy as np
from tqdm import trange
from types import SimpleNamespace
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.utils.data import DataLoader
from torchvision.utils import save_image
from ... | true | true |
f758d208ddb3c925001fab0f7db87f8a82249f64 | 2,290 | py | Python | remedy/remedy.py | 4n6ir/remedy-scan-ecr-repositories | 8979edd7936ccaaa60e8f98b791f84a64e8be4f8 | [
"Apache-2.0"
] | 4 | 2021-12-21T03:02:30.000Z | 2021-12-29T20:44:00.000Z | remedy/remedy.py | 4n6ir/remedy-scan-ecr-repositories | 8979edd7936ccaaa60e8f98b791f84a64e8be4f8 | [
"Apache-2.0"
] | null | null | null | remedy/remedy.py | 4n6ir/remedy-scan-ecr-repositories | 8979edd7936ccaaa60e8f98b791f84a64e8be4f8 | [
"Apache-2.0"
] | null | null | null | import boto3
import json
import logging
import os
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def handler(event, context):
repo_count = 0
img_count = 0
ec2 = boto3.client('ec2')
regions = ec2.describe_regions()
### Region Loop ###
for region in regions['Regio... | 30.945946 | 83 | 0.465066 | import boto3
import json
import logging
import os
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def handler(event, context):
repo_count = 0
img_count = 0
ec2 = boto3.client('ec2')
regions = ec2.describe_regions()
for region in regions['Regions']:
... | true | true |
f758d223ba907a1ef4e96c98282edbdf25dfde75 | 3,209 | py | Python | jiant/jiant/tasks/lib/counterfactual_nli.py | wh629/CNLI-generalization | 5c6d4df5f6a7e58d23c6db1a9dbc50eb9bcfda2b | [
"MIT"
] | 1 | 2021-10-15T23:18:43.000Z | 2021-10-15T23:18:43.000Z | jiant/jiant/tasks/lib/counterfactual_nli.py | wh629/CNLI-generalization | 5c6d4df5f6a7e58d23c6db1a9dbc50eb9bcfda2b | [
"MIT"
] | null | null | null | jiant/jiant/tasks/lib/counterfactual_nli.py | wh629/CNLI-generalization | 5c6d4df5f6a7e58d23c6db1a9dbc50eb9bcfda2b | [
"MIT"
] | null | null | null | import numpy as np
import torch
from dataclasses import dataclass
from typing import List
from jiant.tasks.core import (
BaseExample,
BaseTokenizedExample,
BaseDataRow,
BatchMixin,
Task,
TaskTypes,
)
from jiant.tasks.lib.templates.shared import double_sentence_featurize, labels_to_bimap
from ji... | 27.663793 | 107 | 0.627298 | import numpy as np
import torch
from dataclasses import dataclass
from typing import List
from jiant.tasks.core import (
BaseExample,
BaseTokenizedExample,
BaseDataRow,
BatchMixin,
Task,
TaskTypes,
)
from jiant.tasks.lib.templates.shared import double_sentence_featurize, labels_to_bimap
from ji... | true | true |
f758d28efb67b79b1785a7d9285b906567f8a88f | 5,862 | py | Python | robust_loss/fit_partition_spline.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | robust_loss/fit_partition_spline.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | robust_loss/fit_partition_spline.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.064935 | 80 | 0.696691 |
from absl import app
import numpy as np
import tensorflow.compat.v2 as tf
from robust_loss import cubic_spline
from robust_loss import distribution
from robust_loss import general
tf.enable_v2_behavior()
def numerical_base_partition_function(alpha):
num_samples = 2**24 + 1 x_max = 10**10
power = 6
t =... | true | true |
f758d30990ab886f226cded852f7b56aaecc19b7 | 4,900 | py | Python | temboardui/model/orm.py | missmoiselle/temboard | ff9f0da27a8cf815f3ff41ee29c63554c48519ae | [
"PostgreSQL"
] | 294 | 2016-09-21T09:35:42.000Z | 2022-03-31T15:03:47.000Z | temboardui/model/orm.py | missmoiselle/temboard | ff9f0da27a8cf815f3ff41ee29c63554c48519ae | [
"PostgreSQL"
] | 667 | 2016-10-06T16:27:48.000Z | 2022-03-24T08:56:22.000Z | temboardui/model/orm.py | missmoiselle/temboard | ff9f0da27a8cf815f3ff41ee29c63554c48519ae | [
"PostgreSQL"
] | 46 | 2016-09-22T15:22:29.000Z | 2022-03-04T10:36:16.000Z | import datetime
from sqlalchemy import (
Boolean,
DateTime,
Integer,
String,
event,
)
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import (
case,
column,
extract,
func,
)
from temboardui.model import tables
Mode... | 23.671498 | 77 | 0.626735 | import datetime
from sqlalchemy import (
Boolean,
DateTime,
Integer,
String,
event,
)
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import (
case,
column,
extract,
func,
)
from temboardui.model import tables
Mode... | true | true |
f758d533b36ba6fd1da61425e1c03475009fd885 | 2,377 | py | Python | experiment.py | yagmurtumukluu/shopee-challenge | 132bd0353dfe64e00d6c42b7325bfd841d3e6e45 | [
"MIT"
] | null | null | null | experiment.py | yagmurtumukluu/shopee-challenge | 132bd0353dfe64e00d6c42b7325bfd841d3e6e45 | [
"MIT"
] | null | null | null | experiment.py | yagmurtumukluu/shopee-challenge | 132bd0353dfe64e00d6c42b7325bfd841d3e6e45 | [
"MIT"
] | null | null | null | import logging
import pytorch_metric_learning.utils.logging_presets as logging_presets
import sentencepiece as spm
import torch
from pytorch_metric_learning import losses, miners, samplers, trainers, testers
from pytorch_metric_learning.utils.accuracy_calculator import AccuracyCalculator
from config import SPIECE_MOD... | 26.707865 | 80 | 0.772402 | import logging
import pytorch_metric_learning.utils.logging_presets as logging_presets
import sentencepiece as spm
import torch
from pytorch_metric_learning import losses, miners, samplers, trainers, testers
from pytorch_metric_learning.utils.accuracy_calculator import AccuracyCalculator
from config import SPIECE_MOD... | true | true |
f758d7f8c815790bb856640b51b1a704cf603b44 | 2,613 | py | Python | examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | 2 | 2020-01-07T21:27:38.000Z | 2020-11-21T06:02:50.000Z | examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | null | null | null | examples/neural_network_inference/tensorflow_converter/Tensorflow_1/linear_mnist_train.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | 1 | 2019-04-02T09:20:23.000Z | 2019-04-02T09:20:23.000Z | from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data # Import MINST data
def linear_model(x):
# x is the image input
# mnist data image of shape 28*28=784
# Set model weights
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf... | 30.034483 | 79 | 0.656334 | from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def linear_model(x):
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
pred = tf.nn.softmax(tf.matmul(x, W) + b)
return pred
def train():
mnist ... | true | true |
f758d8268c15dfa3976d3f16037d71b4d530b518 | 1,012 | py | Python | tests/example_tests/test_sync_cmdclass_pyproject.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 423 | 2021-03-22T08:45:12.000Z | 2022-03-31T21:05:53.000Z | tests/example_tests/test_sync_cmdclass_pyproject.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 1 | 2022-02-23T08:53:24.000Z | 2022-03-23T14:11:54.000Z | tests/example_tests/test_sync_cmdclass_pyproject.py | linshoK/pysen | 2b84a15240c5a47cadd8e3fc8392c54c2995b0b1 | [
"MIT"
] | 9 | 2021-03-26T14:20:07.000Z | 2022-03-24T13:17:06.000Z | import pathlib
import subprocess
import pytest
from setuptools import sandbox
from pysen.path import change_dir
TARGET_EXAMPLE = "sync_cmdclass_pyproject"
@pytest.mark.examples
def test_cli_run(example_dir: pathlib.Path) -> None:
target = example_dir / TARGET_EXAMPLE
with change_dir(target):
subpro... | 27.351351 | 85 | 0.704545 | import pathlib
import subprocess
import pytest
from setuptools import sandbox
from pysen.path import change_dir
TARGET_EXAMPLE = "sync_cmdclass_pyproject"
@pytest.mark.examples
def test_cli_run(example_dir: pathlib.Path) -> None:
target = example_dir / TARGET_EXAMPLE
with change_dir(target):
subpro... | true | true |
f758d955f03853d5e77d880dc63bd656f7eef532 | 770 | py | Python | tests/AOJ/test_ITP1_6_B.py | nabetama-training/CompetitionProgrammingPractice | 0801173df3992c2e78b02b383f2df9ba792cbf2f | [
"BSD-2-Clause"
] | null | null | null | tests/AOJ/test_ITP1_6_B.py | nabetama-training/CompetitionProgrammingPractice | 0801173df3992c2e78b02b383f2df9ba792cbf2f | [
"BSD-2-Clause"
] | 2 | 2020-07-04T04:19:28.000Z | 2020-07-26T06:16:07.000Z | tests/AOJ/test_ITP1_6_B.py | nabetama-training/CompetitionProgrammingPractice | 0801173df3992c2e78b02b383f2df9ba792cbf2f | [
"BSD-2-Clause"
] | null | null | null | import sys
from io import StringIO
import unittest
from src.AOJ.ITP1_6_B import resolve
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
... | 10.547945 | 59 | 0.590909 | import sys
from io import StringIO
import unittest
from src.AOJ.ITP1_6_B import resolve
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdout, sys.stdin = StringIO(), StringIO(input)
resolve()
sys.stdout.seek(0)
... | true | true |
f758d9841670a47317358b738069eb38696c094b | 542 | py | Python | env/lib/python3.8/site-packages/plotly/validators/scatter3d/projection/y/_scale.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/scatter3d/projection/y/_scale.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/scatter3d/projection/y/_scale.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class ScaleValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="scale", parent_name="scatter3d.projection.y", **kwargs
):
super(ScaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | 31.882353 | 81 | 0.607011 | import _plotly_utils.basevalidators
class ScaleValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="scale", parent_name="scatter3d.projection.y", **kwargs
):
super(ScaleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=... | true | true |
f758da1d10a8be550af33ea6fb6894442361595a | 4,622 | py | Python | code/train/train.py | mlopstemplates/Ignitedemo | 9a8329d8aaa4c82b0f322b6e677df5b1769050ea | [
"MIT"
] | null | null | null | code/train/train.py | mlopstemplates/Ignitedemo | 9a8329d8aaa4c82b0f322b6e677df5b1769050ea | [
"MIT"
] | null | null | null | code/train/train.py | mlopstemplates/Ignitedemo | 9a8329d8aaa4c82b0f322b6e677df5b1769050ea | [
"MIT"
] | null | null | null | import os
import argparse
import itertools
import numpy as np
import joblib
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score
from sklearn.model_selection import train_test_split
from azureml.c... | 35.553846 | 135 | 0.680225 | import os
import argparse
import itertools
import numpy as np
import joblib
import matplotlib.pyplot as plt
from sklearn import datasets
from sklearn.svm import SVC
from sklearn.metrics import confusion_matrix, precision_score, recall_score, f1_score
from sklearn.model_selection import train_test_split
from azureml.c... | true | true |
f758dac26c4e057c350fe5e638fabd37c34eef9d | 8,115 | py | Python | contrib/devtools/update-translations.py | Basecoin-BAB/Basecoin-Core | 39facf86b3d34b82256ea27f76c701e905f6b918 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Basecoin-BAB/Basecoin-Core | 39facf86b3d34b82256ea27f76c701e905f6b918 | [
"MIT"
] | null | null | null | contrib/devtools/update-translations.py | Basecoin-BAB/Basecoin-Core | 39facf86b3d34b82256ea27f76c701e905f6b918 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 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 foll... | 38.459716 | 124 | 0.632656 | import subprocess
import re
import sys
import os
import io
import xml.etree.ElementTree as ET
TX = 'tx'
SOURCE_LANG = 'basecoin_en.ts'
LOCALE_DIR = 'src/qt/locale'
MIN_NUM_MESSAGES = 10
def check_at_repository_root():
if not os.path.exists('.git'):
print('No .git directory found')
print('Execute t... | true | true |
f758db469a5ed90b15e393662bea370f14b35040 | 824 | py | Python | server/urls.py | RS-GIS-Geeks/AQI-Background | 4bfe52285b826e38f82c8652230cbbaa6ebd5c62 | [
"Apache-2.0"
] | 1 | 2021-01-05T07:51:50.000Z | 2021-01-05T07:51:50.000Z | server/urls.py | RS-GIS-Geeks/AQI-Background | 4bfe52285b826e38f82c8652230cbbaa6ebd5c62 | [
"Apache-2.0"
] | null | null | null | server/urls.py | RS-GIS-Geeks/AQI-Background | 4bfe52285b826e38f82c8652230cbbaa6ebd5c62 | [
"Apache-2.0"
] | null | null | null | """server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... | 34.333333 | 77 | 0.711165 | from django.contrib import admin
from django.urls import path, include
from aqiserver import urls
urlpatterns = [
path('admin/', admin.site.urls),
path('', include(urls.urlpatterns))
]
| true | true |
f758dba9c8f6db2d042873a651109bfce1c11d81 | 93,020 | py | Python | pyNastran/bdf/cards/dmig.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/dmig.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | null | null | null | pyNastran/bdf/cards/dmig.py | Msegade/pyNastran | ae36548579c6bb2ee3a4fff207f7211c1986a5ab | [
"BSD-3-Clause"
] | 1 | 2020-10-04T19:28:07.000Z | 2020-10-04T19:28:07.000Z | # pylint: disable=R0902,R0904,R0914
from math import sin, cos, radians, atan2, sqrt, degrees
from itertools import count
from typing import Tuple # , TYPE_CHECKING
import numpy as np
from numpy import array, zeros
from scipy.sparse import coo_matrix # type: ignore
from pyNastran.utils.numpy_utils import integer_type... | 36.636471 | 114 | 0.490239 | from math import sin, cos, radians, atan2, sqrt, degrees
from itertools import count
from typing import Tuple
import numpy as np
from numpy import array, zeros
from scipy.sparse import coo_matrix
from pyNastran.utils.numpy_utils import integer_types
from pyNastran.bdf.cards.base_card import BaseCard
from pyNastran.b... | true | true |
f758dc97339a2090f91694aff8ea942072daafa5 | 7,797 | py | Python | datasetIO.py | ktian08/6784-drugs | 7c3ae9f65ce60b031008b0026bb9b954575315fa | [
"MIT"
] | 1 | 2020-06-13T00:40:21.000Z | 2020-06-13T00:40:21.000Z | datasetIO.py | ktian08/6784-drugs | 7c3ae9f65ce60b031008b0026bb9b954575315fa | [
"MIT"
] | null | null | null | datasetIO.py | ktian08/6784-drugs | 7c3ae9f65ce60b031008b0026bb9b954575315fa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Andrew D. Rouillard
Computational Biologist
Target Sciences
GSK
andrew.d.rouillard@gsk.com
"""
import os
import gzip
import pickle
import numpy as np
import dataclasses as dc
def load_datasetinfo(datasetspath):
dataset_info = []
with open(datasetspath, mode='rt', encoding="utf-8", ... | 49.348101 | 160 | 0.582019 |
import os
import gzip
import pickle
import numpy as np
import dataclasses as dc
def load_datasetinfo(datasetspath):
dataset_info = []
with open(datasetspath, mode='rt', encoding="utf-8", errors="surrogateescape") as fr:
fields = [x.strip() for x in fr.readline().split('\t')]
for line in fr:
... | true | true |
f758dccb2a8de614d215bf329caa55cd7184acbc | 1,821 | py | Python | epsagon/runners/celery.py | clericeon/epsagon-python | 387b785708d5b6ac0e8a9f8562c52f56d0825cdf | [
"MIT"
] | null | null | null | epsagon/runners/celery.py | clericeon/epsagon-python | 387b785708d5b6ac0e8a9f8562c52f56d0825cdf | [
"MIT"
] | null | null | null | epsagon/runners/celery.py | clericeon/epsagon-python | 387b785708d5b6ac0e8a9f8562c52f56d0825cdf | [
"MIT"
] | null | null | null | """
Runner for a Celery Python function
"""
from __future__ import absolute_import
import time
from uuid import uuid4
from importlib import import_module
from ..event import BaseEvent
from ..utils import add_data_if_needed
class CeleryRunner(BaseEvent):
"""
Represents Python Celery event runner.
"""
... | 25.291667 | 75 | 0.554091 |
from __future__ import absolute_import
import time
from uuid import uuid4
from importlib import import_module
from ..event import BaseEvent
from ..utils import add_data_if_needed
class CeleryRunner(BaseEvent):
ORIGIN = 'runner'
RESOURCE_TYPE = 'celery'
OPERATION = 'execute'
def __init__(self, *args... | true | true |
f758dcd5da8ddc609d44a07bef8764620a9c1d04 | 1,667 | py | Python | Config/query_configservice.py | kyhau/arki | b5d6b160ef0780032f231362158dd9dd892f4e8e | [
"MIT"
] | 1 | 2020-05-12T13:35:50.000Z | 2020-05-12T13:35:50.000Z | Config/query_configservice.py | kyhau/arki | b5d6b160ef0780032f231362158dd9dd892f4e8e | [
"MIT"
] | 18 | 2018-09-03T09:31:11.000Z | 2020-07-06T09:56:34.000Z | Config/query_configservice.py | kyhau/arki | b5d6b160ef0780032f231362158dd9dd892f4e8e | [
"MIT"
] | null | null | null | import click
import logging
from os.path import basename, exists
from shutil import rmtree
from helper.aws import AwsApiHelper
logging.getLogger().setLevel(logging.DEBUG)
class Helper(AwsApiHelper):
def __init__(self, sql_file):
super().__init__()
self._sql_file = sql_file
with open(sql_f... | 32.057692 | 123 | 0.646671 | import click
import logging
from os.path import basename, exists
from shutil import rmtree
from helper.aws import AwsApiHelper
logging.getLogger().setLevel(logging.DEBUG)
class Helper(AwsApiHelper):
def __init__(self, sql_file):
super().__init__()
self._sql_file = sql_file
with open(sql_f... | true | true |
f758dd0289c2cf6d87801f7fa912bfa16a1ae740 | 823 | py | Python | generate_dmrpp.py | vbjayanti/dmrpp-file-generator-docker | d6b5da3e9a00242c853b20300e510930035cc11e | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | vbjayanti/dmrpp-file-generator-docker | d6b5da3e9a00242c853b20300e510930035cc11e | [
"Apache-2.0"
] | null | null | null | generate_dmrpp.py | vbjayanti/dmrpp-file-generator-docker | d6b5da3e9a00242c853b20300e510930035cc11e | [
"Apache-2.0"
] | null | null | null | from os import listdir, getenv
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
import logging
import json
logging.getLogger()
if __name__ == "__main__":
payload = getenv('PAYLOAD', '{}')
meta = json.loads(payload)
workstation_path = getenv('MO... | 45.722222 | 135 | 0.668287 | from os import listdir, getenv
from os.path import isfile, join, basename
from dmrpp_generator.main import DMRPPGenerator
from re import match
import logging
import json
logging.getLogger()
if __name__ == "__main__":
payload = getenv('PAYLOAD', '{}')
meta = json.loads(payload)
workstation_path = getenv('MO... | true | true |
f758dd5598e782f396750d94ba466bbe7d504b89 | 1,662 | py | Python | solutions/python/Lesson02-03/Operation.py | 0xLiso/DeepLearningFromScratch | 997e94953b9e5e1ffd8c38af9277e7925e0b4ea7 | [
"CC0-1.0"
] | 2 | 2022-01-10T21:22:10.000Z | 2022-01-10T21:22:14.000Z | solutions/python/Lesson02-03/Operation.py | 0xLiso/DeepLearningFromScratch | 997e94953b9e5e1ffd8c38af9277e7925e0b4ea7 | [
"CC0-1.0"
] | null | null | null | solutions/python/Lesson02-03/Operation.py | 0xLiso/DeepLearningFromScratch | 997e94953b9e5e1ffd8c38af9277e7925e0b4ea7 | [
"CC0-1.0"
] | 1 | 2021-05-09T23:17:17.000Z | 2021-05-09T23:17:17.000Z | import numpy as np
from Tensor import Tensor
class Operation:
result = None
def forward(self):
raise NotImplementedError
def backward(self, gradOutput: Tensor):
raise NotImplementedError
class Negative(Operation):
def __init__(self, A: Tensor,B:Tensor):
self.A = A
def forward(self):
self.result = ... | 16.455446 | 63 | 0.652828 | import numpy as np
from Tensor import Tensor
class Operation:
result = None
def forward(self):
raise NotImplementedError
def backward(self, gradOutput: Tensor):
raise NotImplementedError
class Negative(Operation):
def __init__(self, A: Tensor,B:Tensor):
self.A = A
def forward(self):
self.result = ... | true | true |
f758de11235ecd17f99ee62e8dff7e421c650588 | 306 | py | Python | contests/pythonist_3/capitalize.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2017-07-02T01:35:39.000Z | 2017-07-02T01:35:39.000Z | contests/pythonist_3/capitalize.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | null | null | null | contests/pythonist_3/capitalize.py | delaanthonio/hackerrank | b1f2e1e93b3260be90eb3b8cb8e86e9a700acf27 | [
"MIT"
] | 1 | 2018-04-03T15:11:56.000Z | 2018-04-03T15:11:56.000Z | """
Capitalize!
:author: Dela Anthonio
:hackerrank: https://hackerrank.com/delaanthonio
:problem: https://www.hackerrank.com/contests/pythonist3/challenges/capitalize
"""
def solve(s: str):
words = [word.capitalize() for word in s.split(' ')]
return " ".join(words)
print(solve('hi jake hj ')) | 23.538462 | 78 | 0.696078 |
def solve(s: str):
words = [word.capitalize() for word in s.split(' ')]
return " ".join(words)
print(solve('hi jake hj ')) | true | true |
f758df81a85fa66a2064e994b7e4086003f54fd7 | 1,992 | py | Python | source/data_model/python/test/lue_test/test_case.py | OliverSchmitz/lue | da097e8c1de30724bfe7667cc04344b6535b40cd | [
"MIT"
] | null | null | null | source/data_model/python/test/lue_test/test_case.py | OliverSchmitz/lue | da097e8c1de30724bfe7667cc04344b6535b40cd | [
"MIT"
] | null | null | null | source/data_model/python/test/lue_test/test_case.py | OliverSchmitz/lue | da097e8c1de30724bfe7667cc04344b6535b40cd | [
"MIT"
] | null | null | null | import os
import shlex
import subprocess
import unittest
import numpy
import lue
import lue_test
class TestCase(unittest.TestCase):
@classmethod
def dataset_name(self,
module_name,
filename):
return "{}.lue".format(
os.path.join(os.path.dirname(module_name), filena... | 24.9 | 76 | 0.596386 | import os
import shlex
import subprocess
import unittest
import numpy
import lue
import lue_test
class TestCase(unittest.TestCase):
@classmethod
def dataset_name(self,
module_name,
filename):
return "{}.lue".format(
os.path.join(os.path.dirname(module_name), filena... | true | true |
f758df94c02195bdc2147a24a0e97c331597592a | 4,984 | py | Python | tests/test_numerical_predictor.py | xrael/orbit-predictor | 9ff616122be0b33e43144bd32a055e1f676801dd | [
"MIT"
] | null | null | null | tests/test_numerical_predictor.py | xrael/orbit-predictor | 9ff616122be0b33e43144bd32a055e1f676801dd | [
"MIT"
] | null | null | null | tests/test_numerical_predictor.py | xrael/orbit-predictor | 9ff616122be0b33e43144bd32a055e1f676801dd | [
"MIT"
] | null | null | null | import datetime as dt
from unittest import TestCase
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
from orbit_predictor.locations import ARG
from orbit_predictor.predictors.numerical import (
J2Predictor, InvalidOrbitError, R_E_KM, is_sun_synchronous
)
class J2Pr... | 36.379562 | 99 | 0.700241 | import datetime as dt
from unittest import TestCase
import numpy as np
from numpy.testing import assert_allclose, assert_almost_equal
import pytest
from orbit_predictor.locations import ARG
from orbit_predictor.predictors.numerical import (
J2Predictor, InvalidOrbitError, R_E_KM, is_sun_synchronous
)
class J2Pr... | true | true |
f758dfa79e70a70ba5acb97cc450854e241efcef | 447 | py | Python | setup.py | azizmb/pushwhendone | b2ab4e64ca88c200e470a87cdb668f7871d06ec3 | [
"Apache-2.0"
] | null | null | null | setup.py | azizmb/pushwhendone | b2ab4e64ca88c200e470a87cdb668f7871d06ec3 | [
"Apache-2.0"
] | null | null | null | setup.py | azizmb/pushwhendone | b2ab4e64ca88c200e470a87cdb668f7871d06ec3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(
name='notify-when-done',
version='1.0',
description='Send push notifications to monitor long running jobs',
author='Aziz M. Bookwala',
author_email='aziz.mansur@gmail.com',
url='https://github.com/azizmb/pushwhendone',
py_module... | 23.526316 | 71 | 0.646532 |
from distutils.core import setup
setup(
name='notify-when-done',
version='1.0',
description='Send push notifications to monitor long running jobs',
author='Aziz M. Bookwala',
author_email='aziz.mansur@gmail.com',
url='https://github.com/azizmb/pushwhendone',
py_modules=['notify_when_done']... | true | true |
f758dfb0d9a4ed9ee3de22519a3abc3113e8b448 | 324 | py | Python | tests/types/test_any_of.py | manoadamro/flapi-schema | 840cfe4bd0ff1e057c3ace9931bd35d8fdaf7808 | [
"MIT"
] | null | null | null | tests/types/test_any_of.py | manoadamro/flapi-schema | 840cfe4bd0ff1e057c3ace9931bd35d8fdaf7808 | [
"MIT"
] | null | null | null | tests/types/test_any_of.py | manoadamro/flapi-schema | 840cfe4bd0ff1e057c3ace9931bd35d8fdaf7808 | [
"MIT"
] | null | null | null | import unittest
from flapi_schema.types import AnyOf
class AnyOfTest(unittest.TestCase):
def test_any_of(self):
rule = AnyOf(lambda _: True, lambda _: False)
self.assertTrue(rule({}))
def test_fails(self):
rule = AnyOf(lambda _: False, lambda _: False)
self.assertFalse(rule({... | 23.142857 | 54 | 0.657407 | import unittest
from flapi_schema.types import AnyOf
class AnyOfTest(unittest.TestCase):
def test_any_of(self):
rule = AnyOf(lambda _: True, lambda _: False)
self.assertTrue(rule({}))
def test_fails(self):
rule = AnyOf(lambda _: False, lambda _: False)
self.assertFalse(rule({... | true | true |
f758e0f6de379bdf101a73414de50d2c1a4eac68 | 10,609 | py | Python | samples/cortex/m3-iar/stm32f2xx/6-round-robin/cfg/script/scmIC.py | diamondx131/scmrtos-sample-projects | 3b34a485b6ca4b16705c250383ae5d30c81966f1 | [
"MIT"
] | 9 | 2015-10-07T15:27:27.000Z | 2021-04-07T06:13:24.000Z | samples/cortex/m3-iar/stm32f2xx/6-round-robin/cfg/script/scmIC.py | diamondx131/scmrtos-sample-projects | 3b34a485b6ca4b16705c250383ae5d30c81966f1 | [
"MIT"
] | 4 | 2017-07-04T10:51:51.000Z | 2019-09-25T11:20:24.000Z | samples/cortex/m3-iar/stm32f2xx/6-round-robin/cfg/script/scmIC.py | diamondx131/scmrtos-sample-projects | 3b34a485b6ca4b16705c250383ae5d30c81966f1 | [
"MIT"
] | 9 | 2015-12-04T15:34:32.000Z | 2020-07-01T16:10:59.000Z | #*******************************************************************************
#
# scmRTOS Integrity Checker Script
#
# Version 2.1
#
# Copyright (c) 2006-2011, Harry E. Zhurov
#
#
# DESCRIPTION:
#
#
# FUNCTIONALITY:
#
#
#******************************************************... | 31.763473 | 138 | 0.459138 |
import sys
import os
import getopt
import glob
import re
class TProcess:
def __init__(self, pr, name):
self.pr = pr
self.name = name
self.procs = []
self.execs = []
def rip_comments(f):
s = re.sub('\/\/.*\n', ' ', f)
s = re.sub('\n', ' ', s)
s = re.sub('\/\*.*?\*\/... | false | true |
f758e1d0a4e4db9df617b04c187ac800e35e44fb | 7,158 | py | Python | api/typechecker.py | nixiaocang/work | 1fdab83c8749e36da8c17c0d6c20f67212c35ce5 | [
"MIT"
] | null | null | null | api/typechecker.py | nixiaocang/work | 1fdab83c8749e36da8c17c0d6c20f67212c35ce5 | [
"MIT"
] | 2 | 2021-02-08T20:22:38.000Z | 2021-04-30T20:39:07.000Z | api/typechecker.py | nixiaocang/work | 1fdab83c8749e36da8c17c0d6c20f67212c35ce5 | [
"MIT"
] | null | null | null | from api.exceptions import DatasourceBadParameterTypeError
import os
import six
import importlib
class TypeChecker:
primitive_types = set(["unsigned int", "int", "bool", "string", "Object",
"datetime", "float"])
def __init__(self, type_check_info, type_check_enum):
self._type_check_info = typ... | 38.691892 | 106 | 0.59905 | from api.exceptions import DatasourceBadParameterTypeError
import os
import six
import importlib
class TypeChecker:
primitive_types = set(["unsigned int", "int", "bool", "string", "Object",
"datetime", "float"])
def __init__(self, type_check_info, type_check_enum):
self._type_check_info = typ... | true | true |
f758e3dc9f845783e23ea5d9d50b2e8955adec2a | 1,891 | py | Python | cards/models.py | i-DAT-Qualia/Card-Backend | ad11c4bdecc20f7f8c386c8f3f452cbfd9c9aa73 | [
"Apache-2.0"
] | 1 | 2015-02-17T19:23:48.000Z | 2015-02-17T19:23:48.000Z | cards/models.py | i-DAT-Qualia/Card-Backend | ad11c4bdecc20f7f8c386c8f3f452cbfd9c9aa73 | [
"Apache-2.0"
] | null | null | null | cards/models.py | i-DAT-Qualia/Card-Backend | ad11c4bdecc20f7f8c386c8f3f452cbfd9c9aa73 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class Batch(models.Model):
name = models.CharField(max_length=250)
notes = models.TextField(blank=True)
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.name
class Card(models.Mo... | 29.546875 | 82 | 0.718139 | from django.db import models
class Batch(models.Model):
name = models.CharField(max_length=250)
notes = models.TextField(blank=True)
added = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)
def __unicode__(self):
return self.name
class Card(models.Mo... | true | true |
f758e3e74d07ab371713077f3d4282812353bda6 | 216 | py | Python | breviar/cli/text.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | 1 | 2020-04-13T12:14:50.000Z | 2020-04-13T12:14:50.000Z | breviar/cli/text.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | null | null | null | breviar/cli/text.py | hairygeek/breviar | b563f3887c367ce6e859b69cfb2513081335969b | [
"Apache-2.0"
] | null | null | null | BITLY_CONFIGURE_PROMPT = 'Please enter the bitly API access token. ' \
'You can get it here (login to the bitly first): ' \
'https://bitly.is/accesstoken\nAPI token'
| 54 | 77 | 0.564815 | BITLY_CONFIGURE_PROMPT = 'Please enter the bitly API access token. ' \
'You can get it here (login to the bitly first): ' \
'https://bitly.is/accesstoken\nAPI token'
| true | true |
f758e5801a46107e513720a4d5ddb37a2c491f77 | 2,424 | py | Python | certbot-dns-google/setup.py | FirstBlue/certbot | 05a9ded297daf58144d966c6d6276f039761dd8d | [
"Apache-2.0"
] | null | null | null | certbot-dns-google/setup.py | FirstBlue/certbot | 05a9ded297daf58144d966c6d6276f039761dd8d | [
"Apache-2.0"
] | 3 | 2022-03-24T21:03:53.000Z | 2022-03-24T21:04:43.000Z | certbot-dns-google/setup.py | pertinkoira/certbot | 9ef6110e36e0cd03611409350de08b49b09c5bf2 | [
"Apache-2.0"
] | null | null | null | import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.26.0.dev0'
install_requires = [
'google-api-python-client>=1.5.5',
'oauth2client>=4.0',
'setuptools>=41.6.0',
# already a dependency of google-api-python-client, but added for consistency
'httplib2... | 31.480519 | 81 | 0.631188 | import os
import sys
from setuptools import find_packages
from setuptools import setup
version = '1.26.0.dev0'
install_requires = [
'google-api-python-client>=1.5.5',
'oauth2client>=4.0',
'setuptools>=41.6.0',
'httplib2'
]
if not os.environ.get('SNAP_BUILD'):
install_requires.extend([
... | true | true |
f758e65b8ab13e8864eba1240e6c6fa481ba1836 | 1,165 | py | Python | netests/converters/vrf/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | 14 | 2020-06-08T07:34:59.000Z | 2022-03-14T08:52:03.000Z | netests/converters/vrf/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | null | null | null | netests/converters/vrf/arista/api.py | Netests/netests | 1a48bda461761c4ec854d6fa0c38629049009a4a | [
"MIT"
] | 3 | 2020-06-19T03:57:05.000Z | 2020-06-22T22:46:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from netests.constants import NOT_SET
from netests.protocols.vrf import VRF, ListVRF
def _arista_vrf_api_converter(
hostname: str(),
cmd_output,
options={}
) -> ListVRF:
if not isinstance(cmd_output['result'][0], dict):
cmd_output = ... | 25.326087 | 66 | 0.538197 |
import json
from netests.constants import NOT_SET
from netests.protocols.vrf import VRF, ListVRF
def _arista_vrf_api_converter(
hostname: str(),
cmd_output,
options={}
) -> ListVRF:
if not isinstance(cmd_output['result'][0], dict):
cmd_output = json.loads(cmd_output['result'][0])
else:
... | true | true |
f758e662a9b9bb671955f33099f8d8d8b680a117 | 6,279 | py | Python | utils/wsi_util.py | PingjunChen/ThyroidRule | 1213cf0783c84da5917ca903c156e5e4280402f5 | [
"MIT"
] | 6 | 2020-02-10T00:48:38.000Z | 2022-03-03T22:11:43.000Z | utils/wsi_util.py | PingjunChen/ThyroidRule | 1213cf0783c84da5917ca903c156e5e4280402f5 | [
"MIT"
] | null | null | null | utils/wsi_util.py | PingjunChen/ThyroidRule | 1213cf0783c84da5917ca903c156e5e4280402f5 | [
"MIT"
] | 1 | 2022-02-01T21:22:30.000Z | 2022-02-01T21:22:30.000Z | # -*- coding: utf-8 -*-
import os, sys, pdb
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as data
from torchvision import datasets, transforms
import numpy as np
import cv2, copy, time
import matplotlib.pyplot as plt
from scipy.ndimage import binary_fill_hol... | 36.505814 | 111 | 0.681637 |
import os, sys, pdb
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torch.utils.data as data
from torchvision import datasets, transforms
import numpy as np
import cv2, copy, time
import matplotlib.pyplot as plt
from scipy.ndimage import binary_fill_holes, binary_closing, bina... | true | true |
f758e74ca35f4a23c425c9643a551e99f5c3a376 | 13,657 | py | Python | Mask-Predict/fairseq/data/language_pair_context_mask.py | shawnkx/NAT-with-Local-AT | 16b29e068ad568e3a020f1309e140aa0dbc38479 | [
"MIT"
] | 6 | 2020-11-17T18:54:08.000Z | 2022-01-21T16:21:18.000Z | Mask-Predict/fairseq/data/language_pair_context_mask.py | shawnkx/NAT-with-Local-AT | 16b29e068ad568e3a020f1309e140aa0dbc38479 | [
"MIT"
] | 2 | 2021-01-01T10:57:32.000Z | 2021-01-13T01:17:35.000Z | Mask-Predict/fairseq/data/language_pair_context_mask.py | shawnkx/NAT-with-Local-AT | 16b29e068ad568e3a020f1309e140aa0dbc38479 | [
"MIT"
] | 1 | 2020-12-29T12:02:44.000Z | 2020-12-29T12:02:44.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import numpy as np
import torch
im... | 44.485342 | 156 | 0.616094 |
import numpy as np
import torch
import random
from fairseq import utils
from . import data_utils, FairseqDataset
def collate(
samples, pad_idx, eos_idx, left_pad_source=True, left_pad_target=False,
input_feeding=True,
):
if len(samples) == 0:
return {}
def merge(key, is_list=False):
... | true | true |
f758e7c1bf16c899372e3789e8a66097ad4e83ee | 1,759 | py | Python | reactivated/utils.py | silviogutierrez/reactivated | 8bbd3095cd07af5bb022f110233a184fd3946b44 | [
"MIT"
] | 178 | 2018-10-24T07:58:26.000Z | 2022-03-31T10:26:57.000Z | reactivated/utils.py | silviogutierrez/reactivated | 8bbd3095cd07af5bb022f110233a184fd3946b44 | [
"MIT"
] | 26 | 2019-10-19T02:52:08.000Z | 2022-03-23T16:47:33.000Z | reactivated/utils.py | silviogutierrez/reactivated | 8bbd3095cd07af5bb022f110233a184fd3946b44 | [
"MIT"
] | 5 | 2019-07-25T03:55:03.000Z | 2022-03-21T04:19:50.000Z | import collections
from typing import Any, Sequence
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Manager
# Mock is_simple_callable for now
# instead of the more sophisticated one from rest_framework.fields
def is_simple_callable(possible_callable: Any) -> bool:
return callab... | 35.897959 | 103 | 0.621376 | import collections
from typing import Any, Sequence
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Manager
def is_simple_callable(possible_callable: Any) -> bool:
return callable(possible_callable)
def get_attribute(instance: Any, attrs: Sequence[str]) -> Any:
for attr i... | true | true |
f758e8652e6f0705aa0ffbb9e6250cce2735e79b | 1,070 | py | Python | astrogame/game/resources.py | siddharth2016/AstroGame | 59e12789d42728b5efb06f2aabaa4beee3656a1f | [
"MIT"
] | null | null | null | astrogame/game/resources.py | siddharth2016/AstroGame | 59e12789d42728b5efb06f2aabaa4beee3656a1f | [
"MIT"
] | null | null | null | astrogame/game/resources.py | siddharth2016/AstroGame | 59e12789d42728b5efb06f2aabaa4beee3656a1f | [
"MIT"
] | null | null | null | import pyglet
def center_image(image):
"""Sets an image's anchor point to its center"""
image.anchor_x = image.width / 2
image.anchor_y = image.height / 2
# Tell pyglet where to find the resources
pyglet.resource.path = ['../resources']
pyglet.resource.reindex()
# Load the three main resources and get ... | 33.4375 | 86 | 0.769159 | import pyglet
def center_image(image):
image.anchor_x = image.width / 2
image.anchor_y = image.height / 2
pyglet.resource.path = ['../resources']
pyglet.resource.reindex()
player_image = pyglet.resource.image("player.png")
center_image(player_image)
bullet_image = pyglet.resource.image("bullet.png")
cente... | true | true |
f758e9676a070288012ccf6c88da50de208142d9 | 175 | py | Python | lib/partitioner/constants.py | hashnfv/hashnfv-domino | eb2fbb1315e6489dd159c8227030d035bdeb1864 | [
"Apache-2.0"
] | null | null | null | lib/partitioner/constants.py | hashnfv/hashnfv-domino | eb2fbb1315e6489dd159c8227030d035bdeb1864 | [
"Apache-2.0"
] | null | null | null | lib/partitioner/constants.py | hashnfv/hashnfv-domino | eb2fbb1315e6489dd159c8227030d035bdeb1864 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Licence statement goes here
#
tosca_ordered_fields = ['tosca_definitions_version', 'description', 'metadata', 'policy_types', 'topology_template']
| 21.875 | 116 | 0.754286 |
tosca_ordered_fields = ['tosca_definitions_version', 'description', 'metadata', 'policy_types', 'topology_template']
| true | true |
f758eb0f984c084453bf0e61f9f630becb039f17 | 4,998 | py | Python | test/specs/openapi/test_expressions.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 659 | 2020-09-03T13:27:50.000Z | 2022-03-31T17:07:16.000Z | test/specs/openapi/test_expressions.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 651 | 2019-08-23T09:16:35.000Z | 2020-09-02T08:30:10.000Z | test/specs/openapi/test_expressions.py | gluhar2006/schemathesis | 3cb6b0b4f5d93242da1f2e79575b6b7b3b7a63d1 | [
"MIT"
] | 66 | 2020-09-05T07:09:03.000Z | 2022-03-17T08:17:55.000Z | import json
import pytest
import requests
from hypothesis import given
from hypothesis import strategies as st
from schemathesis import Case
from schemathesis.models import APIOperation
from schemathesis.specs.openapi import expressions
from schemathesis.specs.openapi.expressions.errors import RuntimeExpressionError
... | 30.47561 | 120 | 0.554022 | import json
import pytest
import requests
from hypothesis import given
from hypothesis import strategies as st
from schemathesis import Case
from schemathesis.models import APIOperation
from schemathesis.specs.openapi import expressions
from schemathesis.specs.openapi.expressions.errors import RuntimeExpressionError
... | true | true |
f758eb58b889ac7d8142ca3a97ab1a003abb1050 | 6,901 | py | Python | dvc/dependency/repo.py | amritghimire/dvc-1 | 27666ffba7002c82ad3a3f8a4399c79056722e41 | [
"Apache-2.0"
] | null | null | null | dvc/dependency/repo.py | amritghimire/dvc-1 | 27666ffba7002c82ad3a3f8a4399c79056722e41 | [
"Apache-2.0"
] | 99 | 2021-03-29T08:59:15.000Z | 2022-03-31T04:10:23.000Z | dvc/dependency/repo.py | amritghimire/dvc-1 | 27666ffba7002c82ad3a3f8a4399c79056722e41 | [
"Apache-2.0"
] | null | null | null | import os
from collections import defaultdict
from copy import copy
from typing import TYPE_CHECKING, Dict, Optional, Set, Tuple
from voluptuous import Required
from dvc.path_info import PathInfo
from .base import Dependency
if TYPE_CHECKING:
from dvc.hash_info import HashInfo
from dvc.objects.db.base impor... | 32.706161 | 79 | 0.573105 | import os
from collections import defaultdict
from copy import copy
from typing import TYPE_CHECKING, Dict, Optional, Set, Tuple
from voluptuous import Required
from dvc.path_info import PathInfo
from .base import Dependency
if TYPE_CHECKING:
from dvc.hash_info import HashInfo
from dvc.objects.db.base impor... | true | true |
f758ec4b8cf6dc9008bdbffdc8dcdade5c9251e9 | 3,423 | py | Python | fairseq_las/data/data_utils.py | sooftware/Fairseq-Listen-Attend-Spell | 9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04 | [
"MIT"
] | 14 | 2020-11-30T16:44:52.000Z | 2021-09-01T02:39:54.000Z | fairseq_las/data/data_utils.py | sooftware/Fairseq-Listen-Attend-Spell | 9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04 | [
"MIT"
] | null | null | null | fairseq_las/data/data_utils.py | sooftware/Fairseq-Listen-Attend-Spell | 9c66b3e7afef8bdcd24c6e71efffc45b8db6ae04 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
def calc_mean_invstddev(feature):
if len(feature.size()) != 2:
raise ValueError("We expect the input feature to be ... | 34.575758 | 91 | 0.668712 |
import torch
def calc_mean_invstddev(feature):
if len(feature.size()) != 2:
raise ValueError("We expect the input feature to be 2-D tensor")
mean = feature.mean(0)
var = feature.var(0)
eps = 1e-8
if (var < eps).any():
return mean, 1.0 / (torch.sqrt(var) + eps)
return mean,... | true | true |
f758ecaf904c0fecbf7b4c39b449c3a7e7ccf168 | 534 | py | Python | django/tests/regressiontests/text/tests.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | null | null | null | django/tests/regressiontests/text/tests.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | null | null | null | django/tests/regressiontests/text/tests.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | 1 | 2018-12-06T12:50:52.000Z | 2018-12-06T12:50:52.000Z | """
# Tests for stuff in django.utils.text.
>>> from django.utils.text import *
### smart_split ###########################################################
>>> list(smart_split(r'''This is "a person" test.'''))
['This', 'is', '"a person"', 'test.']
>>> print list(smart_split(r'''This is "a person's" test.'''))[2]
"a ... | 29.666667 | 75 | 0.522472 | true | true | |
f758ee190e1b7b8b48efe4f419a4abee52ba2d90 | 248 | py | Python | src/tools/palette/onPanelInsideChange.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 108 | 2020-11-23T01:22:37.000Z | 2022-03-29T09:27:32.000Z | src/tools/palette/onPanelInsideChange.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 794 | 2020-11-21T22:27:37.000Z | 2022-03-24T06:41:19.000Z | src/tools/palette/onPanelInsideChange.py | t3kt/raytk | e0e2b3643b2f536d597c5db64f02d17f7e8f23ac | [
"CC-BY-4.0"
] | 3 | 2021-06-19T00:57:54.000Z | 2021-11-01T11:55:07.000Z | # noinspection PyUnreachableCode
if False:
# noinspection PyUnresolvedReferences
from _stubs import *
from .palette import Palette
ext.palette = Palette(COMP())
def onValueChange(panelValue, prev):
ext.palette.onPanelInsideChange(panelValue)
| 24.8 | 44 | 0.806452 | if False:
from _stubs import *
from .palette import Palette
ext.palette = Palette(COMP())
def onValueChange(panelValue, prev):
ext.palette.onPanelInsideChange(panelValue)
| true | true |
f758f10d47f2172b547ff70ceeb15e4f6e19e1b7 | 111 | py | Python | keras_multi_head/__init__.py | SpereShelde/keras-multi-head | a09b46f544b3886c9747ef969be8237a5e93ae6e | [
"MIT"
] | 214 | 2018-10-11T03:02:58.000Z | 2022-03-20T05:09:09.000Z | keras_multi_head/__init__.py | SpereShelde/keras-multi-head | a09b46f544b3886c9747ef969be8237a5e93ae6e | [
"MIT"
] | 10 | 2019-04-29T16:54:00.000Z | 2021-06-19T09:22:54.000Z | keras_multi_head/__init__.py | SpereShelde/keras-multi-head | a09b46f544b3886c9747ef969be8237a5e93ae6e | [
"MIT"
] | 46 | 2018-11-11T13:17:20.000Z | 2022-03-18T09:24:13.000Z | from .multi_head import MultiHead
from .multi_head_attention import MultiHeadAttention
__version__ = '0.28.0'
| 22.2 | 52 | 0.828829 | from .multi_head import MultiHead
from .multi_head_attention import MultiHeadAttention
__version__ = '0.28.0'
| true | true |
f758f29fc25fc0e51f0c0c25c80bade6a654e2dc | 296 | py | Python | Exercicios/Todos/ex090.py | Edson921/exerciciosResolvidos | 72a3089f4848650c62ac0dd876abf5695a64525a | [
"MIT"
] | null | null | null | Exercicios/Todos/ex090.py | Edson921/exerciciosResolvidos | 72a3089f4848650c62ac0dd876abf5695a64525a | [
"MIT"
] | null | null | null | Exercicios/Todos/ex090.py | Edson921/exerciciosResolvidos | 72a3089f4848650c62ac0dd876abf5695a64525a | [
"MIT"
] | null | null | null | dados = {'nome': str(input('Nome: ')), 'média': float(input('Média: '))}
if dados['média'] > 9:
dados['situação'] = 'apto'
elif 6 < dados['média'] < 10:
dados['situação'] = 'recurso'
else:
dados['situação'] = 'Ñapto'
for chave, valor in dados.items():
print(f'{chave} é {valor}')
| 29.6 | 72 | 0.581081 | dados = {'nome': str(input('Nome: ')), 'média': float(input('Média: '))}
if dados['média'] > 9:
dados['situação'] = 'apto'
elif 6 < dados['média'] < 10:
dados['situação'] = 'recurso'
else:
dados['situação'] = 'Ñapto'
for chave, valor in dados.items():
print(f'{chave} é {valor}')
| true | true |
f758f2a2aea38910ae2e89d5cbbe923c2a7173c7 | 1,590 | py | Python | Bugscan_exploits-master/exp_list/exp-753.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 11 | 2020-05-30T13:53:49.000Z | 2021-03-17T03:20:59.000Z | Bugscan_exploits-master/exp_list/exp-753.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-13T03:25:18.000Z | 2020-07-21T06:24:16.000Z | Bugscan_exploits-master/exp_list/exp-753.py | csadsl/poc_exp | e3146262e7403f19f49ee2db56338fa3f8e119c9 | [
"MIT"
] | 6 | 2020-05-30T13:53:51.000Z | 2020-12-01T21:44:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#author:DWBH
#Exploit Title : Wordpress N-Media Website Contact Form with File Upload 1.3.4
import sys
import re
def assign(service, arg):
if service == "wordpress":
return True, arg
def audit(arg):
uploader=''
payload='/wp-admin/admin-aja... | 39.75 | 98 | 0.620126 | import sys
import re
def assign(service, arg):
if service == "wordpress":
return True, arg
def audit(arg):
uploader=''
payload='/wp-admin/admin-ajax.php'
uploaderdir_url = 'wp-content/uploads/contact_files/'
data = ''
data += "------WebKitFormBoundaryoWXEZaqFafD1oOAq\r\... | true | true |
f758f2b2ff9ff7f76c0df83f59ab5f5236aa9b9b | 1,381 | py | Python | tests/test_0006-deep-iteration.py | colesbury/awkward-1.0 | d036ab18eb54de8a2571d9f179d315ac8ee22119 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0006-deep-iteration.py | colesbury/awkward-1.0 | d036ab18eb54de8a2571d9f179d315ac8ee22119 | [
"BSD-3-Clause"
] | null | null | null | tests/test_0006-deep-iteration.py | colesbury/awkward-1.0 | d036ab18eb54de8a2571d9f179d315ac8ee22119 | [
"BSD-3-Clause"
] | null | null | null | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import sys
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_iterator():
content = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3]))
offsets = ak.layout.Index32(np.ar... | 32.116279 | 87 | 0.641564 |
import sys
import pytest import numpy as np import awkward as ak
def test_iterator():
content = ak.layout.NumpyArray(np.array([1.1, 2.2, 3.3]))
offsets = ak.layout.Index32(np.array([0, 2, 2, 3], "i4"))
array = ak.layout.ListOffsetArray32(offsets, content)
assert list(content) == [1.1, 2.2, 3.3]
... | true | true |
f758f400196518d331974673063ca73b81a7a435 | 1,878 | py | Python | TurtleChase.py | ewiertel/TurtleChase | 45615d8dd68dc8e9894316e2e674240bb5a8cf01 | [
"MIT"
] | null | null | null | TurtleChase.py | ewiertel/TurtleChase | 45615d8dd68dc8e9894316e2e674240bb5a8cf01 | [
"MIT"
] | null | null | null | TurtleChase.py | ewiertel/TurtleChase | 45615d8dd68dc8e9894316e2e674240bb5a8cf01 | [
"MIT"
] | null | null | null | import superturtle, turtle
turtle.setup(500,500)
wn = turtle.Screen()
wn.title("Turtle Chase!")
wn.bgcolor("pink")
player_one = superturtle.SuperTurtle()
player_two = superturtle.SuperTurtle()
# make anouncements
player_one.write(" Bet you can't catch me!")
player_two.write(" Im gonna catch you man.")
# he... | 26.828571 | 59 | 0.689031 | import superturtle, turtle
turtle.setup(500,500)
wn = turtle.Screen()
wn.title("Turtle Chase!")
wn.bgcolor("pink")
player_one = superturtle.SuperTurtle()
player_two = superturtle.SuperTurtle()
player_one.write(" Bet you can't catch me!")
player_two.write(" Im gonna catch you man.")
# helper functions
def q... | true | true |
f758f4a7ddd39ce7ce1170f33e29bdbaa1cea1bf | 8,759 | py | Python | src/lambda/cmd/cmd.py | aws-samples/cqrs-lab-on-aws | 5ea2b80426ccde0f6a76ffde25b0cbf2b35cb250 | [
"MIT-0"
] | 7 | 2020-03-20T03:56:54.000Z | 2021-11-08T09:43:41.000Z | src/lambda/cmd/cmd.py | aws-samples/cqrs-lab-on-aws | 5ea2b80426ccde0f6a76ffde25b0cbf2b35cb250 | [
"MIT-0"
] | null | null | null | src/lambda/cmd/cmd.py | aws-samples/cqrs-lab-on-aws | 5ea2b80426ccde0f6a76ffde25b0cbf2b35cb250 | [
"MIT-0"
] | 1 | 2021-10-30T20:42:10.000Z | 2021-10-30T20:42:10.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import os
import json
import uuid
import boto3
import datetime
flight_table_name = os.environ['ORDER_TABLE_NAME']
init_db_lambda_name = os.environ['INITDB_LAMBDA_NAME']
dynamodb = boto3.resource('dynamodb')
table =... | 33.431298 | 132 | 0.457586 |
import os
import json
import uuid
import boto3
import datetime
flight_table_name = os.environ['ORDER_TABLE_NAME']
init_db_lambda_name = os.environ['INITDB_LAMBDA_NAME']
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(flight_table_name)
lam = boto3.client('lambda')
def http_return(body):
return {... | true | true |
f758f55ce5da6c71304dfa8e621b182fbb97feea | 350 | py | Python | zsh/.jupyter/jupyter_qtconsole_config.py | mrossinek/dotfiles | 3fd5e271cbff8641766cabe9201c2e45f18caa5c | [
"MIT"
] | 3 | 2019-07-15T13:25:00.000Z | 2021-02-08T19:20:11.000Z | zsh/.jupyter/jupyter_qtconsole_config.py | mrossinek/dotfiles | 3fd5e271cbff8641766cabe9201c2e45f18caa5c | [
"MIT"
] | null | null | null | zsh/.jupyter/jupyter_qtconsole_config.py | mrossinek/dotfiles | 3fd5e271cbff8641766cabe9201c2e45f18caa5c | [
"MIT"
] | null | null | null | c.JupyterConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.hide_menubar = True
c.ConsoleWidget.include_other_output = True
c.HistoryConsoleWidget.include_other_output = True
c.FrontendWidget.include_other_output = True
c.JupyterWidget.include_other_output = True
c.JupyterW... | 38.888889 | 50 | 0.857143 | c.JupyterConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.confirm_exit = False
c.JupyterQtConsoleApp.hide_menubar = True
c.ConsoleWidget.include_other_output = True
c.HistoryConsoleWidget.include_other_output = True
c.FrontendWidget.include_other_output = True
c.JupyterWidget.include_other_output = True
c.JupyterW... | true | true |
f758f5bde014883e689d6b9e814c9b825b9f54bc | 6,625 | py | Python | qa/rpc-tests/rawtransactions.py | egyptianbman/zelcash | 4561a9af62611e4bf0edfb0a4294ed48cc013026 | [
"MIT"
] | null | null | null | qa/rpc-tests/rawtransactions.py | egyptianbman/zelcash | 4561a9af62611e4bf0edfb0a4294ed48cc013026 | [
"MIT"
] | null | null | null | qa/rpc-tests/rawtransactions.py | egyptianbman/zelcash | 4561a9af62611e4bf0edfb0a4294ed48cc013026 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 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 re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly) coinb... | 41.93038 | 147 | 0.641208 |
import sys; assert sys.version_info < (3,), ur"This script does not run under Python 3. Please use Python 2.7.x."
from test_framework.test_framework import BitcoinTestFramework
from test_framework.authproxy import JSONRPCException
from test_framework.util import assert_equal, initialize_chain_clean, \
start_node... | false | true |
f758f6f927fbd0d9f4bc2db377e7f4b00d9e73a3 | 5,682 | py | Python | tests/test_client.py | shinseitaro/pybotters | 2f8504fa798ebddacda9ae13edafa56816bffeea | [
"MIT"
] | null | null | null | tests/test_client.py | shinseitaro/pybotters | 2f8504fa798ebddacda9ae13edafa56816bffeea | [
"MIT"
] | null | null | null | tests/test_client.py | shinseitaro/pybotters | 2f8504fa798ebddacda9ae13edafa56816bffeea | [
"MIT"
] | null | null | null | import asyncio
import json
from unittest.mock import mock_open
import aiohttp
import pytest
import pytest_mock
import pybotters
async def test_client():
apis = {
'name1': ['key1', 'secret1'],
'name2': ['key2', 'secret2'],
'name3': ['key3', 'secret3'],
}
base_url = 'http://example... | 36.191083 | 88 | 0.686026 | import asyncio
import json
from unittest.mock import mock_open
import aiohttp
import pytest
import pytest_mock
import pybotters
async def test_client():
apis = {
'name1': ['key1', 'secret1'],
'name2': ['key2', 'secret2'],
'name3': ['key3', 'secret3'],
}
base_url = 'http://example... | true | true |
f758f7aa20df075e98ccdec26dfac81d4bb37c97 | 9,927 | py | Python | contrib/spendfrom/spendfrom.py | lyradevelopers/core | d0e628ca772b57235bf44a053597e2598de93566 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | lyradevelopers/core | d0e628ca772b57235bf44a053597e2598de93566 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | lyradevelopers/core | d0e628ca772b57235bf44a053597e2598de93566 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend LYRAs received on particular addresses,
# and lyra any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a lyrad or lyra-Qt r... | 37.041045 | 111 | 0.628589 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
f758f7f368a6c82965bd179f1790197cfa3433c9 | 3,097 | py | Python | setup.py | madsbk/ucx-py | 9946db226bf090f4f097714d681f267da848a7c9 | [
"BSD-3-Clause"
] | null | null | null | setup.py | madsbk/ucx-py | 9946db226bf090f4f097714d681f267da848a7c9 | [
"BSD-3-Clause"
] | null | null | null | setup.py | madsbk/ucx-py | 9946db226bf090f4f097714d681f267da848a7c9 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# See file LICENSE for terms.
# This file is a copy of what is available in a Cython demo + some additions
from __future__ import absolute_import, print_function
import os
from distutils.sysconfig import get_config_var, get_python_inc
import versioneer
... | 30.97 | 80 | 0.658702 |
from __future__ import absolute_import, print_function
import os
from distutils.sysconfig import get_config_var, get_python_inc
import versioneer
from setuptools import setup
from setuptools.extension import Extension
try:
from Cython.Distutils.build_ext import new_build_ext as build_ext
except ImportError:
... | true | true |
f758f8137e12b5019a86ae0c59dcfac15b4f2754 | 1,133 | py | Python | clients/client/python/test/test_submit_self_service_settings_flow_with_lookup_method_body.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_submit_self_service_settings_flow_with_lookup_method_body.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | clients/client/python/test/test_submit_self_service_settings_flow_with_lookup_method_body.py | sproutfi/sdk | 5340b37d7b3e8f3c1b8f4c0c16ede05488498620 | [
"Apache-2.0"
] | null | null | null | """
Ory APIs
Documentation for all public and administrative Ory APIs. Administrative APIs can only be accessed with a valid Personal Access Token. Public APIs are mostly used in browsers. # noqa: E501
The version of the OpenAPI document: v0.0.1-alpha.71
Contact: support@ory.sh
Generated by: htt... | 30.621622 | 194 | 0.765225 |
import sys
import unittest
import ory_client
from ory_client.model.submit_self_service_settings_flow_with_lookup_method_body import SubmitSelfServiceSettingsFlowWithLookupMethodBody
class TestSubmitSelfServiceSettingsFlowWithLookupMethodBody(unittest.TestCase):
def setUp(self):
pass
def tearDown(... | true | true |
f758f8430281ee26a74eca31d5531c769f6f7792 | 11,760 | py | Python | kake/server_client.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | kake/server_client.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | kake/server_client.py | csilvers/kake | 51465b12d267a629dd61778918d83a2a134ec3b2 | [
"MIT"
] | null | null | null | """Routines for talking to a kake-server daemon, spawning one if necessary.
Routines in this module are meant to be used from dev-appserver.
This module defines these routines:
start_server(): spawn a kake server as a daemon, if needed
server_port(): returns port the current kake server is running on
get(): giv... | 37.21519 | 79 | 0.673384 |
from __future__ import absolute_import
import contextlib
import logging
import os
import rfc822
import sys
import time
from google.appengine.api import urlfetch
from . import project_root
from shared import shared_globals
from shared.cache import request_cache
import subprocess_util
assert shared_globals.IS_DEV_S... | true | true |
f758f8741ceba986e1bb5ec87d2b164cbc9c52d5 | 10,054 | py | Python | contrib/spendfrom/spendfrom.py | zouied2000/samacoin | 94d4dfeb9339dd6b10eb8065aaec7fdf47a929d1 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | zouied2000/samacoin | 94d4dfeb9339dd6b10eb8065aaec7fdf47a929d1 | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | zouied2000/samacoin | 94d4dfeb9339dd6b10eb8065aaec7fdf47a929d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Use the raw transactions API to spend bitcoins received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a bitcoind or Bit... | 37.514925 | 111 | 0.632286 |
from decimal import *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.