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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73ad5f54fd5bc781903da9deb8b4774a8785e56 | 2,271 | py | Python | vel/openai/baselines/common/vec_env/dummy_vec_env.py | tigerwlin/vel | 00e4fbb7b612e888e2cbb5d8455146664638cd0b | [
"MIT"
] | null | null | null | vel/openai/baselines/common/vec_env/dummy_vec_env.py | tigerwlin/vel | 00e4fbb7b612e888e2cbb5d8455146664638cd0b | [
"MIT"
] | null | null | null | vel/openai/baselines/common/vec_env/dummy_vec_env.py | tigerwlin/vel | 00e4fbb7b612e888e2cbb5d8455146664638cd0b | [
"MIT"
] | null | null | null | import numpy as np
# from gym import spaces
from bc_gym_planning_env.envs.base import spaces
from collections import OrderedDict
from . import VecEnv
class DummyVecEnv(VecEnv):
def __init__(self, env_fns):
self.envs = [fn() for fn in env_fns]
env = self.envs[0]
VecEnv.__init__(self, len(env... | 32.913043 | 111 | 0.582563 | import numpy as np
from bc_gym_planning_env.envs.base import spaces
from collections import OrderedDict
from . import VecEnv
class DummyVecEnv(VecEnv):
def __init__(self, env_fns):
self.envs = [fn() for fn in env_fns]
env = self.envs[0]
VecEnv.__init__(self, len(env_fns), env.observation_s... | true | true |
f73ad6c195724da595cd5568175cf2d6d8a2d383 | 11,443 | py | Python | handlers/STHandler/__init__.py | rickithadi/sneakpeek | 9219ae2f7e059aff3028ad3d361a41675baf11dd | [
"MIT"
] | null | null | null | handlers/STHandler/__init__.py | rickithadi/sneakpeek | 9219ae2f7e059aff3028ad3d361a41675baf11dd | [
"MIT"
] | null | null | null | handlers/STHandler/__init__.py | rickithadi/sneakpeek | 9219ae2f7e059aff3028ad3d361a41675baf11dd | [
"MIT"
] | null | null | null | import dateutil.parser
import datetime
import time
import re
import requests
from bs4 import BeautifulSoup
from comment import Comment
from difflib import SequenceMatcher
from handlers.AbstractBaseHandler import AbstractBaseHandler, HandlerError
from newspaper import Article
from nltk.util import ngrams
import codecs... | 48.901709 | 1,225 | 0.606397 | import dateutil.parser
import datetime
import time
import re
import requests
from bs4 import BeautifulSoup
from comment import Comment
from difflib import SequenceMatcher
from handlers.AbstractBaseHandler import AbstractBaseHandler, HandlerError
from newspaper import Article
from nltk.util import ngrams
import codecs... | true | true |
f73ad72a01bae2b413234ceb961487abb75f4fc6 | 5,393 | py | Python | dexp/cli/video_commands/overlay.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 16 | 2021-04-21T14:09:19.000Z | 2022-03-22T02:30:59.000Z | dexp/cli/video_commands/overlay.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 28 | 2021-04-15T17:43:08.000Z | 2022-03-29T16:08:35.000Z | dexp/cli/video_commands/overlay.py | haesleinhuepf/dexp | 2ea84f3db323724588fac565fae56f0d522bc5ca | [
"BSD-3-Clause"
] | 3 | 2022-02-08T17:41:30.000Z | 2022-03-18T15:32:27.000Z | import click
from dexp.cli.defaults import _default_workers_backend
from dexp.video.overlay import add_overlays_image_sequence
@click.command()
@click.argument("input_path", type=str)
@click.option("--output_path", "-o", type=str, default=None, help="Output folder for overlayed frames.")
@click.option("--scalebar/--... | 30.297753 | 120 | 0.649546 | import click
from dexp.cli.defaults import _default_workers_backend
from dexp.video.overlay import add_overlays_image_sequence
@click.command()
@click.argument("input_path", type=str)
@click.option("--output_path", "-o", type=str, default=None, help="Output folder for overlayed frames.")
@click.option("--scalebar/--... | true | true |
f73ad750dfbd94912907169da6f40a4583e0b43a | 26,254 | py | Python | old/shiny/match_localities/match_SI_GBIF.py | Smithsonian/Mass-Georeferencing | bb7d81cd82684900003d3049764cd2d243325248 | [
"Apache-2.0"
] | 5 | 2020-06-24T16:12:48.000Z | 2021-11-08T09:46:02.000Z | old/shiny/match_localities/match_SI_GBIF.py | Smithsonian/Mass-Georeferencing | bb7d81cd82684900003d3049764cd2d243325248 | [
"Apache-2.0"
] | 8 | 2020-07-06T21:11:58.000Z | 2020-07-22T13:10:48.000Z | old/shiny/match_localities/match_SI_GBIF.py | Smithsonian/Mass-Georeferencing | bb7d81cd82684900003d3049764cd2d243325248 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Match SI GBIF records without coordinates to other GBIF records for the species/genus
#
import psycopg2, os, logging, sys, locale, psycopg2.extras
import pandas as pd
from time import localtime, strftime
from fuzzywuzzy import fuzz
import pycountry
#Import settings
import settings
#Set loc... | 76.319767 | 503 | 0.611564 |
import psycopg2, os, logging, sys, locale, psycopg2.extras
import pandas as pd
from time import localtime, strftime
from fuzzywuzzy import fuzz
import pycountry
import settings
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
current_time = strftime("%Y%m%d_%H%M%S", localtime())
if not os.path.exists('logs... | true | true |
f73ad7ef473c28b31f934cb214c644f591567ddd | 32,591 | py | Python | inan/farmer/farmer.py | inan0812/chia-blockchain | 8de40989f56fb64d6ff1690ae0c2169cc11ad18b | [
"Apache-2.0"
] | 1 | 2021-09-19T18:59:19.000Z | 2021-09-19T18:59:19.000Z | inan/farmer/farmer.py | inan0812/chia-blockchain | 8de40989f56fb64d6ff1690ae0c2169cc11ad18b | [
"Apache-2.0"
] | null | null | null | inan/farmer/farmer.py | inan0812/chia-blockchain | 8de40989f56fb64d6ff1690ae0c2169cc11ad18b | [
"Apache-2.0"
] | 1 | 2022-02-08T19:58:12.000Z | 2022-02-08T19:58:12.000Z | import asyncio
import json
import logging
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
import traceback
import aiohttp
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
import inan.server.ws_connection as ws # lgtm [py/import-and-import-from]
from ... | 49.986196 | 120 | 0.599184 | import asyncio
import json
import logging
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
import traceback
import aiohttp
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
import inan.server.ws_connection as ws
from inan.consensus.coinbase import cre... | true | true |
f73ad8326fe77a4db799abaf6eab17b6b2d8466b | 561 | py | Python | setup.py | mikemccabe210/amortizedassimilation | 25652884869904d7ec1e1a84856cc364c8420467 | [
"MIT"
] | 3 | 2021-12-07T02:06:15.000Z | 2022-03-01T16:56:23.000Z | setup.py | mikemccabe210/amortizedassimilation | 25652884869904d7ec1e1a84856cc364c8420467 | [
"MIT"
] | null | null | null | setup.py | mikemccabe210/amortizedassimilation | 25652884869904d7ec1e1a84856cc364c8420467 | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="amortized_assimilation",
version="0.0.1",
author="Anonymized",
author_email="Anonymized",
description="Learned uncertainty-aware filters for assimilation noisy high dimensional observational data",
url="Anonymized",
packages=['amortized_assimilation... | 35.0625 | 111 | 0.602496 | import setuptools
setuptools.setup(
name="amortized_assimilation",
version="0.0.1",
author="Anonymized",
author_email="Anonymized",
description="Learned uncertainty-aware filters for assimilation noisy high dimensional observational data",
url="Anonymized",
packages=['amortized_assimilation... | true | true |
f73ad8ae5cf3b32721cc59b89e9267f009100966 | 1,059 | py | Python | src/m1_run_this_on_robot.py | dandanT-T/99-CapstoneProject-201920 | c66efc204dbba94f136af22d48ada6ae346097f1 | [
"MIT"
] | null | null | null | src/m1_run_this_on_robot.py | dandanT-T/99-CapstoneProject-201920 | c66efc204dbba94f136af22d48ada6ae346097f1 | [
"MIT"
] | null | null | null | src/m1_run_this_on_robot.py | dandanT-T/99-CapstoneProject-201920 | c66efc204dbba94f136af22d48ada6ae346097f1 | [
"MIT"
] | null | null | null | """
Capstone Project. Code to run on the EV3 robot (NOT on a laptop).
Author: Your professors (for the framework)
and Zhicheng Kai.
Winter term, 2018-2019.
"""
import rosebot
import mqtt_remote_method_calls as com
import time
import shared_gui_delegate_on_robot
def main():
"""
This code, which mu... | 27.868421 | 79 | 0.580737 |
import rosebot
import mqtt_remote_method_calls as com
import time
import shared_gui_delegate_on_robot
def main():
real_thing()
def real_thing():
robot = rosebot.RoseBot()
delegate = shared_gui_delegate_on_robot.Handler(robot)
mqtt_receiver = com.MqttClient(delegate)
robot.drive_system.mqtt_send... | true | true |
f73ad99f2c1b621669e07354f5a18fcdcd5fb2d0 | 701 | py | Python | predictor.py | omergunal/Attacker-Group-Predictor | 77475abb994b36a04e159d50af44f4ef9baf5da5 | [
"Apache-2.0"
] | 53 | 2020-05-31T18:39:57.000Z | 2022-02-15T07:49:42.000Z | predictor.py | omergunal/Attacker-Group-Predictor | 77475abb994b36a04e159d50af44f4ef9baf5da5 | [
"Apache-2.0"
] | 1 | 2021-08-03T22:02:54.000Z | 2021-08-09T20:02:23.000Z | predictor.py | omergunal/Attacker-Group-Predictor | 77475abb994b36a04e159d50af44f4ef9baf5da5 | [
"Apache-2.0"
] | 11 | 2020-06-03T06:55:14.000Z | 2020-06-21T14:20:47.000Z | import os
from ast import literal_eval
from collections import Counter
def find_groups(techniques,softwares):
f = open("groupInfo.txt", "r")
data = f.read()
data = literal_eval(data)
techniques = techniques.split(",")
softwares = softwares.split(",")
rate = {}
for group in data:
rate[group] = 0
for t... | 23.366667 | 52 | 0.697575 | import os
from ast import literal_eval
from collections import Counter
def find_groups(techniques,softwares):
f = open("groupInfo.txt", "r")
data = f.read()
data = literal_eval(data)
techniques = techniques.split(",")
softwares = softwares.split(",")
rate = {}
for group in data:
rate[group] = 0
for t... | true | true |
f73ad9e6b36c7bb4903f7d10a8322f4abeaafed4 | 16,754 | py | Python | openslides_backend/action/actions/meeting/import_.py | ostcar/openslides-backend | e6ceac497c37a1e3e7f408c6cfb29cf21d985b4c | [
"MIT"
] | null | null | null | openslides_backend/action/actions/meeting/import_.py | ostcar/openslides-backend | e6ceac497c37a1e3e7f408c6cfb29cf21d985b4c | [
"MIT"
] | null | null | null | openslides_backend/action/actions/meeting/import_.py | ostcar/openslides-backend | e6ceac497c37a1e3e7f408c6cfb29cf21d985b4c | [
"MIT"
] | null | null | null | import time
from collections import defaultdict
from typing import Any, Dict, Iterable, Optional, Tuple
from ....models.base import model_registry
from ....models.checker import Checker, CheckException
from ....models.fields import (
BaseGenericRelationField,
BaseRelationField,
BaseTemplateField,
Gener... | 41.885 | 126 | 0.580936 | import time
from collections import defaultdict
from typing import Any, Dict, Iterable, Optional, Tuple
from ....models.base import model_registry
from ....models.checker import Checker, CheckException
from ....models.fields import (
BaseGenericRelationField,
BaseRelationField,
BaseTemplateField,
Gener... | true | true |
f73adadd7703c2725598c49857ef6d2b4ce4bf23 | 2,789 | py | Python | tests/integration/test_compression_nested_columns/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 15,577 | 2019-09-23T11:57:53.000Z | 2022-03-31T18:21:48.000Z | tests/integration/test_compression_nested_columns/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 16,476 | 2019-09-23T11:47:00.000Z | 2022-03-31T23:06:01.000Z | tests/integration/test_compression_nested_columns/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 3,633 | 2019-09-23T12:18:28.000Z | 2022-03-31T15:55:48.000Z | import random
import string
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_zookeeper=True)
node2 = cluster.add_instance('node2', with_zookeeper=True)
@pytest.fixture(scope="module")
def start_cluster():
try:
c... | 40.42029 | 127 | 0.687343 | import random
import string
import pytest
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node1 = cluster.add_instance('node1', with_zookeeper=True)
node2 = cluster.add_instance('node2', with_zookeeper=True)
@pytest.fixture(scope="module")
def start_cluster():
try:
c... | true | true |
f73adb34e962a85c6017136f3cd1d2bd6aea50aa | 145,859 | py | Python | src/pyOpenMS/tests/unittests/test000.py | emilpaulitz/OpenMS | bd19a8cfcfa3bc96f58a1d1e605e094e522c5a6e | [
"BSL-1.0",
"Zlib",
"Apache-2.0"
] | null | null | null | src/pyOpenMS/tests/unittests/test000.py | emilpaulitz/OpenMS | bd19a8cfcfa3bc96f58a1d1e605e094e522c5a6e | [
"BSL-1.0",
"Zlib",
"Apache-2.0"
] | 1 | 2018-10-29T17:15:55.000Z | 2018-11-11T19:29:01.000Z | src/pyOpenMS/tests/unittests/test000.py | emilpaulitz/OpenMS | bd19a8cfcfa3bc96f58a1d1e605e094e522c5a6e | [
"BSL-1.0",
"Zlib",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import pyopenms
import copy
import os
from pyopenms import String as s
import numpy as np
print("IMPORTED ", pyopenms.__file__)
try:
long
except NameError:
long = int
from functools import wraps
import sys
def _testStrOut... | 26.995928 | 128 | 0.69332 |
from __future__ import print_function
import pyopenms
import copy
import os
from pyopenms import String as s
import numpy as np
print("IMPORTED ", pyopenms.__file__)
try:
long
except NameError:
long = int
from functools import wraps
import sys
def _testStrOutput(input_str):
if sys.version_info[0] < ... | true | true |
f73adb8ad71550654c63d4f0f2a53eb404ed330e | 2,019 | py | Python | gammapy/datasets/tests/test_datasets.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 155 | 2015-02-25T12:38:02.000Z | 2022-03-13T17:54:30.000Z | gammapy/datasets/tests/test_datasets.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 3,131 | 2015-01-06T15:36:23.000Z | 2022-03-31T17:30:57.000Z | gammapy/datasets/tests/test_datasets.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 158 | 2015-03-16T20:36:44.000Z | 2022-03-30T16:05:37.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
from numpy.testing import assert_allclose
from gammapy.datasets import Datasets
from gammapy.modeling.tests.test_fit import MyDataset
@pytest.fixture(scope="session")
def datasets():
return Datasets([MyDataset(name="test-1"), MyDataset(... | 29.691176 | 75 | 0.678554 |
import pytest
from numpy.testing import assert_allclose
from gammapy.datasets import Datasets
from gammapy.modeling.tests.test_fit import MyDataset
@pytest.fixture(scope="session")
def datasets():
return Datasets([MyDataset(name="test-1"), MyDataset(name="test-2")])
def test_datasets_init(datasets):
D... | true | true |
f73adc78f1eeb493cb04a5690be0ceee688064e3 | 12,032 | py | Python | watcher/common/clients.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | 64 | 2015-10-18T02:57:24.000Z | 2022-01-13T11:27:51.000Z | watcher/common/clients.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | null | null | null | watcher/common/clients.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | 35 | 2015-12-25T13:53:21.000Z | 2021-07-19T15:50:16.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 41.347079 | 79 | 0.604222 |
from oslo_config import cfg
from cinderclient import client as ciclient
from glanceclient import client as glclient
from gnocchiclient import client as gnclient
from ironicclient import client as irclient
from keystoneauth1 import adapter as ka_adapter
from keystoneauth1 import loading as ka_loading
from k... | true | true |
f73add7dc1323902898553e9c6afdc1ebb9324f6 | 38,119 | py | Python | Font Info/Vertical Metrics Manager.py | KatjaSchimmel/Glyphs-Scripts | 0632d810c7849797405ac958c142ff313e2cb4c1 | [
"Apache-2.0"
] | 283 | 2015-01-07T12:35:35.000Z | 2022-03-29T06:10:44.000Z | Font Info/Vertical Metrics Manager.py | KatjaSchimmel/Glyphs-Scripts | 0632d810c7849797405ac958c142ff313e2cb4c1 | [
"Apache-2.0"
] | 203 | 2015-01-26T18:43:08.000Z | 2022-03-04T01:47:58.000Z | Font Info/Vertical Metrics Manager.py | KatjaSchimmel/Glyphs-Scripts | 0632d810c7849797405ac958c142ff313e2cb4c1 | [
"Apache-2.0"
] | 96 | 2015-01-19T20:58:03.000Z | 2022-03-29T06:10:56.000Z | #MenuTitle: Vertical Metrics Manager
# -*- coding: utf-8 -*-
from __future__ import division, print_function, unicode_literals
try:
from builtins import str
except Exception as e:
print("Warning: 'future' module not installed. Run 'sudo pip install future' in Terminal.")
__doc__="""
Manage and sync ascender, descende... | 58.285933 | 436 | 0.738005 |
from __future__ import division, print_function, unicode_literals
try:
from builtins import str
except Exception as e:
print("Warning: 'future' module not installed. Run 'sudo pip install future' in Terminal.")
__doc__="""
Manage and sync ascender, descender and linegap values for hhea, OS/2 sTypo and OS/2 usWin.
"... | true | true |
f73adf1bc3e952e9c8b790f0056b84b1b0be2d37 | 30,413 | py | Python | sublimeText3/Packages/SublimeCodeIntel/libs/koXMLTreeService.py | MoAnsir/dot_file_2017 | 5f67ef8f430416c82322ab7e7e001548936454ff | [
"MIT"
] | 2 | 2018-04-24T10:02:26.000Z | 2019-06-02T13:53:31.000Z | Data/Packages/SublimeCodeIntel/libs/koXMLTreeService.py | Maxize/Sublime_Text_3 | be620476b49f9a6ce2ca2cfe825c4e142e7e82b9 | [
"Apache-2.0"
] | 1 | 2016-02-10T09:50:09.000Z | 2016-02-10T09:50:09.000Z | Packages/SublimeCodeIntel/libs/koXMLTreeService.py | prisis/sublime-text-packages | 99ae8a5496613e27a75e5bd91723549b21476e60 | [
"MIT"
] | 2 | 2019-04-11T04:13:02.000Z | 2019-06-02T13:53:33.000Z | # ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozilla.org/MPL/
#
# Softwa... | 35.281903 | 206 | 0.567553 |
import time
import re
from cElementTree import TreeBuilder, XMLParser, Element
import logging
log = logging.getLogger("koXMLTreeService")
class recollector:
def __init__(self):
self.res = {}
self.regs = {}
def add(self, name, reg, mods=None):
self.... | true | true |
f73ae0439a55adc2eb0dee40fd68949a88eaf15a | 532 | py | Python | router_logic/search.py | sdulaney/project-paul-eggtart | 52f6b099615df31ee40f161c14bfd13f0ea59370 | [
"AFL-3.0"
] | null | null | null | router_logic/search.py | sdulaney/project-paul-eggtart | 52f6b099615df31ee40f161c14bfd13f0ea59370 | [
"AFL-3.0"
] | 2 | 2021-02-08T20:45:03.000Z | 2021-04-30T21:08:59.000Z | router_logic/search.py | sdulaney/project-paul-eggtart | 52f6b099615df31ee40f161c14bfd13f0ea59370 | [
"AFL-3.0"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import TextAreaField, StringField, validators
from wtforms.validators import DataRequired
from fuzzywuzzy import fuzz, process
from TA_functions import *
def closest_match(search):
choices = get_ta_list()
return process.extract(search, choices, limit=1)
def closest_5_ma... | 29.555556 | 72 | 0.785714 | from flask_wtf import FlaskForm
from wtforms import TextAreaField, StringField, validators
from wtforms.validators import DataRequired
from fuzzywuzzy import fuzz, process
from TA_functions import *
def closest_match(search):
choices = get_ta_list()
return process.extract(search, choices, limit=1)
def closest_5_ma... | true | true |
f73ae0753f3b06383b38193a5fcf041fd0a05384 | 492 | py | Python | proyectos_de_ley/pdl/migrations/0002_proyecto_legislatura.py | napsta32/proyectos_de_ley | 63b7737e194a0958f9e95ca92773887000867bc7 | [
"MIT"
] | 12 | 2016-07-27T06:23:52.000Z | 2021-09-08T16:09:52.000Z | proyectos_de_ley/pdl/migrations/0002_proyecto_legislatura.py | napsta32/proyectos_de_ley | 63b7737e194a0958f9e95ca92773887000867bc7 | [
"MIT"
] | 58 | 2015-01-18T14:53:45.000Z | 2021-02-19T06:27:19.000Z | proyectos_de_ley/pdl/migrations/0002_proyecto_legislatura.py | napsta32/proyectos_de_ley | 63b7737e194a0958f9e95ca92773887000867bc7 | [
"MIT"
] | 10 | 2015-01-28T02:20:38.000Z | 2020-11-22T06:23:26.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-09-02 20:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pdl', '0001_initial'),
]
operations = [
migrations.AddField(
mod... | 22.363636 | 66 | 0.611789 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pdl', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='proyecto',
name='legislatura',
field=... | true | true |
f73ae17099d28d789a44f0f1541f2ddc00471769 | 389 | py | Python | seleet/asgi.py | BuildForSDGCohort2/seleet-backend | 17830240936d294d67d5b7a9c750ff30946fc1b6 | [
"BSD-3-Clause"
] | null | null | null | seleet/asgi.py | BuildForSDGCohort2/seleet-backend | 17830240936d294d67d5b7a9c750ff30946fc1b6 | [
"BSD-3-Clause"
] | null | null | null | seleet/asgi.py | BuildForSDGCohort2/seleet-backend | 17830240936d294d67d5b7a9c750ff30946fc1b6 | [
"BSD-3-Clause"
] | null | null | null | """
ASGI config for seleet project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'seleet.settings')
application = get_asgi_application()
| true | true |
f73ae1906aa870e9491ee68db1750a27397161c8 | 40,223 | py | Python | lib/dashboard.py | thebeastadi/explainx | a96d5bc2b78d14bb9a60b3cca3e84b8fba846944 | [
"MIT"
] | 1 | 2020-12-25T14:33:40.000Z | 2020-12-25T14:33:40.000Z | lib/dashboard.py | thebeastadi/explainx | a96d5bc2b78d14bb9a60b3cca3e84b8fba846944 | [
"MIT"
] | null | null | null | lib/dashboard.py | thebeastadi/explainx | a96d5bc2b78d14bb9a60b3cca3e84b8fba846944 | [
"MIT"
] | null | null | null | from imports import *
from plotly_graphs import *
from protodash import *
from insights import *
from plotly_css import *
import pandasql as psql
import string
import random
import os
from apps import global_explanation, local_explanation, distribution, feature_interaction, cohort
from app import app
from what_if impor... | 44.007659 | 208 | 0.529995 | from imports import *
from plotly_graphs import *
from protodash import *
from insights import *
from plotly_css import *
import pandasql as psql
import string
import random
import os
from apps import global_explanation, local_explanation, distribution, feature_interaction, cohort
from app import app
from what_if impor... | true | true |
f73ae1bfe7e33a8885926aa830257fe8b9e5ba14 | 52 | py | Python | apps/people/__init__.py | heykarimoff/covid19-pcr | 635c7880df3da6b5fc693bed5fa68ea7423fbf54 | [
"MIT"
] | null | null | null | apps/people/__init__.py | heykarimoff/covid19-pcr | 635c7880df3da6b5fc693bed5fa68ea7423fbf54 | [
"MIT"
] | null | null | null | apps/people/__init__.py | heykarimoff/covid19-pcr | 635c7880df3da6b5fc693bed5fa68ea7423fbf54 | [
"MIT"
] | 1 | 2022-02-18T14:23:16.000Z | 2022-02-18T14:23:16.000Z | default_app_config = 'apps.people.apps.PeopleConfig' | 52 | 52 | 0.846154 | default_app_config = 'apps.people.apps.PeopleConfig' | true | true |
f73ae1dea50d9c342b26210dec62ee20d2cef153 | 8,565 | py | Python | Bio/Blast/NCBIWWW.py | cymon/biopython-github-master | 7be9697599296401b0a7126d23b5eda391a94116 | [
"PostgreSQL"
] | 1 | 2016-05-09T13:17:59.000Z | 2016-05-09T13:17:59.000Z | Bio/Blast/NCBIWWW.py | cymon/biopython-github-master | 7be9697599296401b0a7126d23b5eda391a94116 | [
"PostgreSQL"
] | null | null | null | Bio/Blast/NCBIWWW.py | cymon/biopython-github-master | 7be9697599296401b0a7126d23b5eda391a94116 | [
"PostgreSQL"
] | null | null | null | # Copyright 1999 by Jeffrey Chang. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
# Patched by Brad Chapman.
# Chris Wroe added modifications for work in myGrid
"""
This modul... | 38.755656 | 95 | 0.608523 |
try:
import cStringIO as StringIO
except ImportError:
import StringIO
def qblast(program, database, sequence,
auto_format=None,composition_based_statistics=None,
db_genetic_code=None,endpoints=None,entrez_query='(none)',
expect=10.0,filter=None,gapcosts=None,genetic_... | true | true |
f73ae27acfddb97a5a793e676d74a4d7a58eef84 | 22,342 | py | Python | cartridge/shop/migrations/0016_add_field_product__meta_title.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/migrations/0016_add_field_product__meta_title.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | cartridge/shop/migrations/0016_add_field_product__meta_title.py | AlexHill/cartridge | cb8599d43600442a223a484dc75726bfbbec68a0 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import unicode_literals
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Product._meta_title'
db.add_column('shop_product', '... | 87.273438 | 197 | 0.561409 | from __future__ import unicode_literals
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column('shop_product', '_meta_title',
self.gf('django.db.mode... | true | true |
f73ae3119d68870cdca0bd4fd22722754526fc33 | 3,689 | py | Python | contrib/macdeploy/custom_dsstore.py | celbalrai/bytz | 23557be163aa3908ba4ae2dc1ec11bce12d1ee2d | [
"MIT"
] | 2 | 2021-09-11T22:50:58.000Z | 2021-09-30T19:55:30.000Z | contrib/macdeploy/custom_dsstore.py | celbalrai/bytz | 23557be163aa3908ba4ae2dc1ec11bce12d1ee2d | [
"MIT"
] | 3 | 2021-07-19T10:25:36.000Z | 2021-07-21T10:47:31.000Z | contrib/macdeploy/custom_dsstore.py | celbalrai/bytz | 23557be163aa3908ba4ae2dc1ec11bce12d1ee2d | [
"MIT"
] | 8 | 2021-03-23T13:25:08.000Z | 2022-03-09T10:45:53.000Z | #!/usr/bin/env python3
# Copyright (c) 2013-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 61.483333 | 1,817 | 0.722689 |
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': '{{300, 280}, {500, 343}}',
'ContainerShowSidebar': False,
'Si... | true | true |
f73ae31313d147e209ed4b6100fc309e4b1e8b53 | 623 | py | Python | migrations/20190401140827_create_db.py | Hiome/core-db | 48834464100858207f9930ec51c592ffa3e6acb8 | [
"MIT"
] | null | null | null | migrations/20190401140827_create_db.py | Hiome/core-db | 48834464100858207f9930ec51c592ffa3e6acb8 | [
"MIT"
] | null | null | null | migrations/20190401140827_create_db.py | Hiome/core-db | 48834464100858207f9930ec51c592ffa3e6acb8 | [
"MIT"
] | null | null | null | from yoyo import step
__transactional__ = False
step(
"""
create table rooms (
id text primary key,
name text not null,
occupancy_count smallint
)
""",
"drop table rooms"
)
step(
"""
create table sensors (
id text primary key,
room_id text,
name text,
type text,
data tex... | 14.159091 | 60 | 0.621188 | from yoyo import step
__transactional__ = False
step(
"""
create table rooms (
id text primary key,
name text not null,
occupancy_count smallint
)
""",
"drop table rooms"
)
step(
"""
create table sensors (
id text primary key,
room_id text,
name text,
type text,
data tex... | true | true |
f73ae32d45268745bd5104686ff427d4eb9ae7ec | 110 | py | Python | lang/Python/logical-operations.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/logical-operations.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | lang/Python/logical-operations.py | ethansaxenian/RosettaDecode | 8ea1a42a5f792280b50193ad47545d14ee371fb7 | [
"MIT"
] | null | null | null | def logic(a, b):
print(('a and b:', a and b))
print(('a or b:', a or b))
print(('not a:', not a))
| 22 | 32 | 0.463636 | def logic(a, b):
print(('a and b:', a and b))
print(('a or b:', a or b))
print(('not a:', not a))
| true | true |
f73ae55e4854ed51ee77e22fd4ab6d024fb2af5f | 1,067 | py | Python | pyenv/lib/python3.6/fnmatch.py | ronald-rgr/ai-chatbot-smartguide | c9c830feb6b66c2e362f8fb5d147ef0c4f4a08cf | [
"Apache-2.0"
] | null | null | null | pyenv/lib/python3.6/fnmatch.py | ronald-rgr/ai-chatbot-smartguide | c9c830feb6b66c2e362f8fb5d147ef0c4f4a08cf | [
"Apache-2.0"
] | 3 | 2020-03-23T18:01:51.000Z | 2021-03-19T23:15:15.000Z | pyenv/lib/python3.6/fnmatch.py | ronald-rgr/ai-chatbot-smartguide | c9c830feb6b66c2e362f8fb5d147ef0c4f4a08cf | [
"Apache-2.0"
] | null | null | null | XSym
0074
fc129c94a8bb7a7f86d859205655f4a4
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/fnmatch.py
... | 213.4 | 949 | 0.095595 | XSym
0074
fc129c94a8bb7a7f86d859205655f4a4
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/fnmatch.py
... | false | true |
f73ae5bfa51589f0a564108914e574a08c276ee4 | 44,448 | py | Python | django/db/models/fields/__init__.py | elreydetoda/feedsanitizer | 81a7cfc3f3d1312cd8c236b3e8cc9e84b0d72932 | [
"MIT"
] | 2 | 2020-03-13T15:07:55.000Z | 2020-03-14T14:45:42.000Z | django/db/models/fields/__init__.py | elreydetoda/feedsanitizer | 81a7cfc3f3d1312cd8c236b3e8cc9e84b0d72932 | [
"MIT"
] | null | null | null | django/db/models/fields/__init__.py | elreydetoda/feedsanitizer | 81a7cfc3f3d1312cd8c236b3e8cc9e84b0d72932 | [
"MIT"
] | 1 | 2020-10-16T04:11:58.000Z | 2020-10-16T04:11:58.000Z | import datetime
import decimal
import re
import time
import math
from itertools import tee
import django.utils.copycompat as copy
from django.db import connection
from django.db.models.fields.subclassing import LegacyConnection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
fro... | 38.087404 | 166 | 0.631524 | import datetime
import decimal
import re
import time
import math
from itertools import tee
import django.utils.copycompat as copy
from django.db import connection
from django.db.models.fields.subclassing import LegacyConnection
from django.db.models.query_utils import QueryWrapper
from django.conf import settings
fro... | false | true |
f73ae7872e61f7219f1b265d16d6de98242da868 | 3,131 | py | Python | 1_django-login-registration_noob/my_project/settings.py | rvcgeeks/Python-Django-101 | c026430b862821feffb45d39cc85cd93bf2e6559 | [
"MIT"
] | null | null | null | 1_django-login-registration_noob/my_project/settings.py | rvcgeeks/Python-Django-101 | c026430b862821feffb45d39cc85cd93bf2e6559 | [
"MIT"
] | null | null | null | 1_django-login-registration_noob/my_project/settings.py | rvcgeeks/Python-Django-101 | c026430b862821feffb45d39cc85cd93bf2e6559 | [
"MIT"
] | null | null | null | """
Django settings for my_project project.
Generated by 'django-admin startproject' using Django 1.10.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import o... | 25.663934 | 91 | 0.69786 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '*wi&v$_lj_y9m_4^i583hb+*zdmm&mx_=c$_v*j9lk*tyaiiwj'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'my_apps.user_auth',
'django.contrib.admin',
'django.contrib.auth',
... | true | true |
f73ae93b5d50ca9a8f7a0a526915ebb7cf8c2c25 | 2,008 | py | Python | PLC/Methods/system/methodSignature.py | dreibh/planetlab-lxc-plcapi | 065dfc54a2b668e99eab343d113f1a31fb154b13 | [
"BSD-3-Clause"
] | null | null | null | PLC/Methods/system/methodSignature.py | dreibh/planetlab-lxc-plcapi | 065dfc54a2b668e99eab343d113f1a31fb154b13 | [
"BSD-3-Clause"
] | null | null | null | PLC/Methods/system/methodSignature.py | dreibh/planetlab-lxc-plcapi | 065dfc54a2b668e99eab343d113f1a31fb154b13 | [
"BSD-3-Clause"
] | null | null | null | from PLC.Parameter import Parameter, Mixed
from PLC.Method import Method, xmlrpc_type
from functools import reduce
class methodSignature(Method):
"""
Returns an array of known signatures (an array of arrays) for the
method name passed. If no signatures are known, returns a
none-array (test for type != ... | 32.387097 | 88 | 0.613546 | from PLC.Parameter import Parameter, Mixed
from PLC.Method import Method, xmlrpc_type
from functools import reduce
class methodSignature(Method):
roles = []
accepts = [Parameter(str, "Method name")]
returns = [Parameter([str], "Method signature")]
def __init__(self, api):
Method.__init__(self... | true | true |
f73aead0cc86b06c28033b4cffeb0979873dae8a | 724 | py | Python | manage.py | pra17dod/Help-People | 2f41d8609749db0134e69ca6d0f57fc165d15e71 | [
"Apache-2.0"
] | null | null | null | manage.py | pra17dod/Help-People | 2f41d8609749db0134e69ca6d0f57fc165d15e71 | [
"Apache-2.0"
] | null | null | null | manage.py | pra17dod/Help-People | 2f41d8609749db0134e69ca6d0f57fc165d15e71 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'helppeople.settings')
try:
from django.core.management import execute_from_command_line
except I... | 27.846154 | 74 | 0.68232 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'helppeople.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f73aeb8a85883b82fe54cba500e7c8d3ee740b33 | 1,898 | py | Python | mlb-ml/api/gameday_api_handler.py | alhart2015/mlb-ml | 5afe4db9f21650c67adeae3c20b558aa0406cb5b | [
"MIT"
] | null | null | null | mlb-ml/api/gameday_api_handler.py | alhart2015/mlb-ml | 5afe4db9f21650c67adeae3c20b558aa0406cb5b | [
"MIT"
] | null | null | null | mlb-ml/api/gameday_api_handler.py | alhart2015/mlb-ml | 5afe4db9f21650c67adeae3c20b558aa0406cb5b | [
"MIT"
] | null | null | null | """
Read from the MLB Gameday API.
Base URL: https://statsapi.mlb.com/docs/#operation/stats
Hitter stat URL: https://statsapi.mlb.com/api/v1/stats?stats=season&group=hitting
"""
from typing import Dict, List
from schema.player import Player
from schema.team import Team
import requests
import utils
def get_top_hitt... | 24.333333 | 92 | 0.684405 | from typing import Dict, List
from schema.player import Player
from schema.team import Team
import requests
import utils
def get_top_hitter_stats() -> List[Player]:
url = utils.HITTER_STATS_URL
response = requests.get(url)
response_json: Dict = response.json()
splits_list = response_json['stat... | true | true |
f73aecc844d33589f61e3d39cf78b5dd02f4dfd0 | 401 | py | Python | dockerfactory/files.py | lukas2511/debian-docker-factory | 73f702f571934022dd3526709be42a8d7a1f1179 | [
"MIT"
] | 2 | 2016-10-21T09:17:09.000Z | 2021-11-15T17:06:25.000Z | dockerfactory/files.py | lukas2511/debian-docker-factory | 73f702f571934022dd3526709be42a8d7a1f1179 | [
"MIT"
] | null | null | null | dockerfactory/files.py | lukas2511/debian-docker-factory | 73f702f571934022dd3526709be42a8d7a1f1179 | [
"MIT"
] | 1 | 2019-11-02T23:34:28.000Z | 2019-11-02T23:34:28.000Z | import os
from glob import glob
def get_latest_file_change(files):
latest = 0
for file in files:
src = file['src']
if os.path.isdir(src):
date = get_latest_file_change(list({'src': x} for x in glob(os.path.join(src, '*'))))
else:
date = os.path.getmtime(src)
... | 23.588235 | 97 | 0.553616 | import os
from glob import glob
def get_latest_file_change(files):
latest = 0
for file in files:
src = file['src']
if os.path.isdir(src):
date = get_latest_file_change(list({'src': x} for x in glob(os.path.join(src, '*'))))
else:
date = os.path.getmtime(src)
... | true | true |
f73aece390b40d44a028d4585966bb5c2e4daddc | 7,156 | py | Python | venv/Lib/site-packages/pandas/tests/series/test_analytics.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/series/test_analytics.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pandas/tests/series/test_analytics.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | import operator
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import DataFrame, Series
import pandas._testing as tm
class TestSeriesAnalytics:
def test_prod_numpy16_bug(self):
s = Series([1.0, 1.0, 1.0], index=range(3))
... | 35.078431 | 88 | 0.561906 | import operator
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import DataFrame, Series
import pandas._testing as tm
class TestSeriesAnalytics:
def test_prod_numpy16_bug(self):
s = Series([1.0, 1.0, 1.0], index=range(3))
... | true | true |
f73aed434e81256421614842c6287ff8d447a05c | 2,287 | py | Python | sitemetrics/providers.py | idlesign/django-sitemetrics | 39f0e468337700d56826f45af407f732da1630cc | [
"BSD-3-Clause"
] | 23 | 2015-03-02T07:34:17.000Z | 2020-08-15T14:42:21.000Z | sitemetrics/providers.py | idlesign/django-sitemetrics | 39f0e468337700d56826f45af407f732da1630cc | [
"BSD-3-Clause"
] | 12 | 2015-03-02T14:06:42.000Z | 2018-09-17T13:53:05.000Z | sitemetrics/providers.py | idlesign/django-sitemetrics | 39f0e468337700d56826f45af407f732da1630cc | [
"BSD-3-Clause"
] | 17 | 2015-02-06T13:38:17.000Z | 2018-10-27T05:46:31.000Z | from typing import List, Type
from django.conf import settings
from django.utils.module_loading import import_module
from django.utils.translation import gettext_lazy as _
class MetricsProvider:
"""Base class for metrics providers."""
alias: str = 'generic'
title: str = 'Generic Provider'
# This ca... | 24.591398 | 88 | 0.64014 | from typing import List, Type
from django.conf import settings
from django.utils.module_loading import import_module
from django.utils.translation import gettext_lazy as _
class MetricsProvider:
alias: str = 'generic'
title: str = 'Generic Provider'
params: dict = None
@classmethod
... | true | true |
f73aed61e48c769853e9970b2ac51ea49caf0389 | 1,607 | py | Python | gpytorch/models/gplvm/bayesian_gplvm.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 2,673 | 2018-02-19T22:28:58.000Z | 2022-03-31T13:22:28.000Z | gpytorch/models/gplvm/bayesian_gplvm.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 1,415 | 2018-02-19T20:38:20.000Z | 2022-03-30T12:53:13.000Z | gpytorch/models/gplvm/bayesian_gplvm.py | llguo95/gpytorch | 1fa69935104565c377ce95d2c581c9eedfb55817 | [
"MIT"
] | 467 | 2018-03-07T02:06:05.000Z | 2022-03-27T07:05:44.000Z | #!/usr/bin/env python3
from ..approximate_gp import ApproximateGP
class BayesianGPLVM(ApproximateGP):
"""
The Gaussian Process Latent Variable Model (GPLVM) class for unsupervised learning.
The class supports
1. Point estimates for latent X when prior_x = None
2. MAP Inference for X when prior_x... | 39.195122 | 139 | 0.728687 |
from ..approximate_gp import ApproximateGP
class BayesianGPLVM(ApproximateGP):
def __init__(self, X, variational_strategy):
super().__init__(variational_strategy)
self.X = X
def forward(self):
raise NotImplementedError
def sample_latent_variable(self):
sample... | true | true |
f73aed6ac99a3e3d6af94507f7a2e6c3fc98de37 | 16,402 | py | Python | src/vgg19/theano_model/vgg19_model.py | dkdanielkost/Theano-Style-Transfer | 70438d3de51d059ea2129119a8cfcc86d2b403a9 | [
"MIT"
] | null | null | null | src/vgg19/theano_model/vgg19_model.py | dkdanielkost/Theano-Style-Transfer | 70438d3de51d059ea2129119a8cfcc86d2b403a9 | [
"MIT"
] | null | null | null | src/vgg19/theano_model/vgg19_model.py | dkdanielkost/Theano-Style-Transfer | 70438d3de51d059ea2129119a8cfcc86d2b403a9 | [
"MIT"
] | null | null | null | import numpy
import os
import numpy as np
import logging
from theano.tensor.signal import pool
from theano.tensor.nnet.abstract_conv import bilinear_upsampling
import joblib
from theano.tensor.nnet import conv2d
from theano.tensor.nnet import relu,softmax
import theano
import theano.tensor as T
from theano.tensor.sign... | 45.688022 | 114 | 0.451286 | import numpy
import os
import numpy as np
import logging
from theano.tensor.signal import pool
from theano.tensor.nnet.abstract_conv import bilinear_upsampling
import joblib
from theano.tensor.nnet import conv2d
from theano.tensor.nnet import relu,softmax
import theano
import theano.tensor as T
from theano.tensor.sign... | true | true |
f73aeddbe4e28a26a55821f625fc47f3d84508cb | 2,796 | py | Python | aliyun-python-sdk-core/aliyunsdkcore/endpoint/endpoint_resolver_rules.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-core/aliyunsdkcore/endpoint/endpoint_resolver_rules.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-core/aliyunsdkcore/endpoint/endpoint_resolver_rules.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with self work for additional information
# regarding copyright ownership. The ASF licenses self file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.942857 | 96 | 0.687411 |
from aliyunsdkcore.endpoint.local_config_regional_endpoint_resolver \
import LocalConfigRegionalEndpointResolver
class EndpointResolverRules(LocalConfigRegionalEndpointResolver):
def __init__(self, *args, **kwargs):
LocalConfigRegionalEndpointResolver.__init__(self)
self.prod... | true | true |
f73aeecf43edac2a6921a2dbc82d15123b3f623e | 1,838 | py | Python | sandbox/maya_attribute_operators.py | parzival-roethlein/mapya | 2395a8922e557acfe7dc4b98c13be7f071127277 | [
"MIT"
] | 1 | 2020-03-20T11:48:34.000Z | 2020-03-20T11:48:34.000Z | sandbox/maya_attribute_operators.py | parzival-roethlein/mapya | 2395a8922e557acfe7dc4b98c13be7f071127277 | [
"MIT"
] | null | null | null | sandbox/maya_attribute_operators.py | parzival-roethlein/mapya | 2395a8922e557acfe7dc4b98c13be7f071127277 | [
"MIT"
] | null | null | null | """
makes python operators of Attribute instances use the attribute value.
the reasoning was to make attribute access less verbose and making all Attribute
operators useful.
NOT USED BECAUSE:
- can already be done using the attr value and python zen says:
There should be one-- and preferably only one --obvious way t... | 34.679245 | 107 | 0.73395 | import operator
class MayaAttributeOperators(object):
pass
def wrap_operator(operator_func, inplace=False):
def inner_operator(self, other):
if isinstance(other, MayaAttributeOperators):
other = other.get()
if inplace:
self.set(operator_func(self.get(), othe... | true | true |
f73aef0b8f2088ee541437f79d63b7db5df12be3 | 1,391 | py | Python | bots/BasicBot.py | jayantabh/haxball-imitation-learning | fb02203dee6859443ac2bd4334144aacc9f16f89 | [
"MIT"
] | null | null | null | bots/BasicBot.py | jayantabh/haxball-imitation-learning | fb02203dee6859443ac2bd4334144aacc9f16f89 | [
"MIT"
] | null | null | null | bots/BasicBot.py | jayantabh/haxball-imitation-learning | fb02203dee6859443ac2bd4334144aacc9f16f89 | [
"MIT"
] | 2 | 2021-07-24T10:15:27.000Z | 2021-09-09T03:25:07.000Z | import replay
import torch
import os
from bots import interactive
from models.BasicModel import BasicModel
class BasicBot(interactive.Interactive):
def __init__(self, channel_id, name):
super().__init__(channel_id)
# Load pre-trained model and set-up the bot
self.model = BasicModel()
path = os.pat... | 33.119048 | 96 | 0.675773 | import replay
import torch
import os
from bots import interactive
from models.BasicModel import BasicModel
class BasicBot(interactive.Interactive):
def __init__(self, channel_id, name):
super().__init__(channel_id)
self.model = BasicModel()
path = os.path.join( os.getcwd(), 'saved_models', name )... | true | true |
f73aef5b111b9d515bad6e9c823f71660de63790 | 2,337 | py | Python | tests/test_squeezedimd.py | hjmjohnson/MONAI | 7cd65614da81eeff261a14abdf18bd07a20abfcc | [
"Apache-2.0"
] | 1 | 2021-06-18T00:53:06.000Z | 2021-06-18T00:53:06.000Z | tests/test_squeezedimd.py | Transconnectome/MONAI | dc7cd0ec25d4b27f321a31f13e707769922c66b3 | [
"Apache-2.0"
] | null | null | null | tests/test_squeezedimd.py | Transconnectome/MONAI | dc7cd0ec25d4b27f321a31f13e707769922c66b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 34.367647 | 99 | 0.632007 |
import unittest
import numpy as np
from parameterized import parameterized
from monai.transforms import SqueezeDimd
TEST_CASE_1 = [
{"keys": ["img", "seg"], "dim": None},
{"img": np.random.rand(1, 2, 1, 3), "seg": np.random.randint(0, 2, size=[1, 2, 1, 3])},
(2, 3),
]
TEST_CASE_2 = [
{"key... | true | true |
f73aef67d32337296bdc1edb4168fbb05501865d | 10,641 | py | Python | gradio/networking.py | WittmannF/gradio | db42e5b3dd22f5a60975a6eda6c81abfbb592cde | [
"Apache-2.0"
] | null | null | null | gradio/networking.py | WittmannF/gradio | db42e5b3dd22f5a60975a6eda6c81abfbb592cde | [
"Apache-2.0"
] | null | null | null | gradio/networking.py | WittmannF/gradio | db42e5b3dd22f5a60975a6eda6c81abfbb592cde | [
"Apache-2.0"
] | null | null | null | """
Defines helper methods useful for setting up ports, launching servers, and handling `ngrok`
"""
import os
import socket
import threading
from flask import Flask, request, jsonify, abort, send_file, render_template
from flask_cachebuster import CacheBuster
from flask_cors import CORS
import threading
import pkg_res... | 34.436893 | 119 | 0.672493 |
import os
import socket
import threading
from flask import Flask, request, jsonify, abort, send_file, render_template
from flask_cachebuster import CacheBuster
from flask_cors import CORS
import threading
import pkg_resources
from distutils import dir_util
import time
import json
import urllib.request
from shutil impo... | true | true |
f73aefa79b47e1039b9702029b3af5cd7718d5a6 | 418 | py | Python | blogproject/settings/production.py | showd0wn/blogproject | 08f250bc31499402a30f68a04485de6ca499c069 | [
"MIT"
] | null | null | null | blogproject/settings/production.py | showd0wn/blogproject | 08f250bc31499402a30f68a04485de6ca499c069 | [
"MIT"
] | null | null | null | blogproject/settings/production.py | showd0wn/blogproject | 08f250bc31499402a30f68a04485de6ca499c069 | [
"MIT"
] | null | null | null | # flake8: noqa
import os
from .common import *
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
# SECURITY WARNING: do... | 24.588235 | 71 | 0.76555 |
import os
from .common import *
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
DEBUG = False
ALLOWED_HOSTS = ['www.qingzhiyu.com']
| true | true |
f73af00cc224bc740577c55aad456233af32e58c | 1,649 | py | Python | ipfshttpclient4ipwb/client/bitswap.py | ibnesayeed/py-ipfs-http-client | c3bce1f28d09b26530a6fe0e8f1b3a8a023bc23b | [
"MIT"
] | null | null | null | ipfshttpclient4ipwb/client/bitswap.py | ibnesayeed/py-ipfs-http-client | c3bce1f28d09b26530a6fe0e8f1b3a8a023bc23b | [
"MIT"
] | null | null | null | ipfshttpclient4ipwb/client/bitswap.py | ibnesayeed/py-ipfs-http-client | c3bce1f28d09b26530a6fe0e8f1b3a8a023bc23b | [
"MIT"
] | null | null | null | from . import base
class Section(base.SectionBase):
@base.returns_single_item
def wantlist(self, peer=None, **kwargs):
"""Returns blocks currently on the bitswap wantlist.
.. code-block:: python
>>> client.bitswap.wantlist()
{'Keys': [
'QmeV6C6XVt1wf7V7as7Yak3mxPma8jzpqyhtRtCvpKcfBb',
'QmdCW... | 25.765625 | 82 | 0.637356 | from . import base
class Section(base.SectionBase):
@base.returns_single_item
def wantlist(self, peer=None, **kwargs):
args = (peer,)
return self._client.request('/bitswap/wantlist', args, decoder='json', **kwargs)
@base.returns_single_item
def stat(self, **kwargs):
return self._client.request('/bitswap... | true | true |
f73af0947b89157946ecb08b611d2c0e698545af | 5,888 | py | Python | exercises/practice/clock/clock_test.py | gsilvapt/python | d675468b2437d4c09c358d023ef998a05a781f58 | [
"MIT"
] | 1,177 | 2017-06-21T20:24:06.000Z | 2022-03-29T02:30:55.000Z | exercises/practice/clock/clock_test.py | gsilvapt/python | d675468b2437d4c09c358d023ef998a05a781f58 | [
"MIT"
] | 1,890 | 2017-06-18T20:06:10.000Z | 2022-03-31T18:35:51.000Z | exercises/practice/clock/clock_test.py | gsilvapt/python | d675468b2437d4c09c358d023ef998a05a781f58 | [
"MIT"
] | 1,095 | 2017-06-26T23:06:19.000Z | 2022-03-29T03:25:38.000Z | import unittest
from clock import (
Clock,
)
# Tests adapted from `problem-specifications//canonical-data.json`
class ClockTest(unittest.TestCase):
# Create A New Clock With An Initial Time
def test_on_the_hour(self):
self.assertEqual(str(Clock(8, 0)), "08:00")
def test_past_the_hour(self):... | 33.83908 | 73 | 0.683084 | import unittest
from clock import (
Clock,
)
class ClockTest(unittest.TestCase):
def test_on_the_hour(self):
self.assertEqual(str(Clock(8, 0)), "08:00")
def test_past_the_hour(self):
self.assertEqual(str(Clock(11, 9)), "11:09")
def test_midnight_is_zero_hours(self):
s... | true | true |
f73af24a942520c19bbff8b58970e2629928f30a | 14,961 | py | Python | samples/client/petstore/python-experimental/tests/test_deserialization.py | joschi/openapi-generator | d949c8181dbaad2b31880093bf41f11da8853843 | [
"Apache-2.0"
] | 1 | 2020-08-07T08:38:39.000Z | 2020-08-07T08:38:39.000Z | samples/client/petstore/python-experimental/tests/test_deserialization.py | joschi/openapi-generator | d949c8181dbaad2b31880093bf41f11da8853843 | [
"Apache-2.0"
] | 1 | 2020-07-08T09:59:39.000Z | 2020-09-07T14:45:18.000Z | samples/client/petstore/python-experimental/tests/test_deserialization.py | joschi/openapi-generator | d949c8181dbaad2b31880093bf41f11da8853843 | [
"Apache-2.0"
] | 1 | 2019-10-06T12:57:47.000Z | 2019-10-06T12:57:47.000Z | # coding: utf-8
# flake8: noqa
"""
Run the tests.
$ pip install nose (optional)
$ cd OpenAPIPetstore-python
$ nosetests -v
"""
from collections import namedtuple
import json
import os
import time
import unittest
import datetime
import six
import petstore_api
from petstore_api.exceptions import (
ApiTypeError,
... | 33.695946 | 86 | 0.56039 |
from collections import namedtuple
import json
import os
import time
import unittest
import datetime
import six
import petstore_api
from petstore_api.exceptions import (
ApiTypeError,
ApiKeyError,
ApiValueError,
)
from petstore_api.model import (
enum_test,
pet,
animal,
dog,
paren... | true | true |
f73af2d1928b4c52de88a1592e0eecc993f5fbed | 4,983 | py | Python | 3d-tracking/run_estimation.py | sadjadasghari/3d-vehicle-tracking | af05d52be81db32fc6a21bf60a757ebc46557998 | [
"BSD-3-Clause"
] | 603 | 2019-05-28T01:53:29.000Z | 2022-03-22T00:26:07.000Z | 3d-tracking/run_estimation.py | reinforcementdriving/3d-vehicle-tracking | f8433f72a51dd1a7190570e63e9fda4a924a81f0 | [
"BSD-3-Clause"
] | 45 | 2019-05-29T05:07:20.000Z | 2022-01-28T04:10:42.000Z | 3d-tracking/run_estimation.py | reinforcementdriving/3d-vehicle-tracking | f8433f72a51dd1a7190570e63e9fda4a924a81f0 | [
"BSD-3-Clause"
] | 149 | 2019-05-28T06:53:12.000Z | 2022-03-24T19:11:58.000Z | import os
import sys
import argparse
import pickle
import subprocess
from time import sleep
'''
Multiple GPUs and processes script for monocular 3D Tracking
'''
def parse_args():
parser = argparse.ArgumentParser(description='Monocular 3D Estimation',
formatter_class=argparse.ArgumentDefaul... | 38.627907 | 89 | 0.593819 | import os
import sys
import argparse
import pickle
import subprocess
from time import sleep
def parse_args():
parser = argparse.ArgumentParser(description='Monocular 3D Estimation',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('set', choices=['gta', 'kitt... | true | true |
f73af3764f5f26559a04b84d15a76e6315064ffd | 3,349 | py | Python | datacube/scripts/system.py | eodcgmbh/datacube-core | 0792e519ccfd33e0a0acf368aa6f33ca2c1ea50f | [
"Apache-2.0"
] | 363 | 2017-03-17T07:33:18.000Z | 2022-03-25T12:33:36.000Z | datacube/scripts/system.py | eodcgmbh/datacube-core | 0792e519ccfd33e0a0acf368aa6f33ca2c1ea50f | [
"Apache-2.0"
] | 1,035 | 2017-03-07T05:38:43.000Z | 2022-03-29T03:19:10.000Z | datacube/scripts/system.py | eodcgmbh/datacube-core | 0792e519ccfd33e0a0acf368aa6f33ca2c1ea50f | [
"Apache-2.0"
] | 146 | 2017-03-08T01:08:37.000Z | 2022-03-16T01:52:13.000Z | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
import logging
import click
from click import echo, style
from sqlalchemy.exc import OperationalError
import datacube
from datacube.index impo... | 33.49 | 119 | 0.693938 |
import logging
import click
from click import echo, style
from sqlalchemy.exc import OperationalError
import datacube
from datacube.index import index_connect
from datacube.drivers.postgres._connections import IndexSetupError
from datacube.ui import click as ui
from datacube.ui.click import cli, handle_exception
... | true | true |
f73af4f2232cb7210ca602af5113efe88a0f4ac9 | 415 | py | Python | env/Lib/site-packages/plotly/validators/mesh3d/colorbar/_ticktext.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/Lib/site-packages/plotly/validators/mesh3d/colorbar/_ticktext.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/Lib/site-packages/plotly/validators/mesh3d/colorbar/_ticktext.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ticktext", parent_name="mesh3d.colorbar", **kwargs):
super(TicktextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | 34.583333 | 88 | 0.686747 | import _plotly_utils.basevalidators
class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(self, plotly_name="ticktext", parent_name="mesh3d.colorbar", **kwargs):
super(TicktextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | true | true |
f73af53b54e191afef42406c6da1960d651d65ce | 1,666 | py | Python | examples/widgets/effectwidget3_advanced.py | yunus-ceyhan/kivy | ba646bd82c8eb5c505c68d18de52f8f3e6cf199a | [
"MIT"
] | 13,889 | 2015-01-01T06:43:41.000Z | 2022-03-31T17:37:56.000Z | examples/widgets/effectwidget3_advanced.py | yunus-ceyhan/kivy | ba646bd82c8eb5c505c68d18de52f8f3e6cf199a | [
"MIT"
] | 4,570 | 2015-01-01T17:58:52.000Z | 2022-03-31T18:42:16.000Z | examples/widgets/effectwidget3_advanced.py | yunus-ceyhan/kivy | ba646bd82c8eb5c505c68d18de52f8f3e6cf199a | [
"MIT"
] | 3,786 | 2015-01-01T09:20:45.000Z | 2022-03-30T21:15:05.000Z | '''
This example demonstrates creating and using an AdvancedEffectBase. In
this case, we use it to efficiently pass the touch coordinates into the shader.
'''
from kivy.base import runTouchApp
from kivy.properties import ListProperty
from kivy.lang import Builder
from kivy.uix.effectwidget import EffectWidget, Advance... | 26.03125 | 79 | 0.67467 |
from kivy.base import runTouchApp
from kivy.properties import ListProperty
from kivy.lang import Builder
from kivy.uix.effectwidget import EffectWidget, AdvancedEffectBase
effect_string = '''
uniform vec2 touch;
vec4 effect(vec4 color, sampler2D texture, vec2 tex_coords, vec2 coords)
{
vec2 distance = 0.025*(co... | true | true |
f73af54edc6c01a915bdfc48de4bc1fc9a35a276 | 2,661 | py | Python | setup.py | RobertRosca/EXtra-data | b226dc4601807551418a5422e7590540e2d736ee | [
"BSD-3-Clause"
] | null | null | null | setup.py | RobertRosca/EXtra-data | b226dc4601807551418a5422e7590540e2d736ee | [
"BSD-3-Clause"
] | 49 | 2021-01-08T10:53:29.000Z | 2022-03-30T22:07:28.000Z | setup.py | RobertRosca/EXtra-data | b226dc4601807551418a5422e7590540e2d736ee | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os.path as osp
import re
from setuptools import setup, find_packages
import sys
def get_script_path():
return osp.dirname(osp.realpath(sys.argv[0]))
def read(*parts):
return open(osp.join(get_script_path(), *parts)).read()
def find_version(*parts):
vers_file = read(*parts)... | 30.586207 | 83 | 0.554303 |
import os.path as osp
import re
from setuptools import setup, find_packages
import sys
def get_script_path():
return osp.dirname(osp.realpath(sys.argv[0]))
def read(*parts):
return open(osp.join(get_script_path(), *parts)).read()
def find_version(*parts):
vers_file = read(*parts)
match = re.searc... | true | true |
f73af56216a461d62f19449f3eae81d65ad088a6 | 123 | py | Python | Codeforces/A_Difference_Row.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/A_Difference_Row.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/A_Difference_Row.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | n = int(input())
l = list(map(int, input().split()))
ans = []
l = sorted(l)
ans = [l[-1]] + l[1:(n-1)] + [l[0]]
print(*ans) | 20.5 | 35 | 0.487805 | n = int(input())
l = list(map(int, input().split()))
ans = []
l = sorted(l)
ans = [l[-1]] + l[1:(n-1)] + [l[0]]
print(*ans) | true | true |
f73af6433f52825790175b44ec70bfe78a54e8ba | 45,942 | py | Python | localstack/services/awslambda/lambda_api.py | pkjmesra/localstack | 586250f1f26a85fb23793707fec38fcd9b38e3ca | [
"Apache-2.0"
] | 1 | 2019-10-29T07:12:03.000Z | 2019-10-29T07:12:03.000Z | localstack/services/awslambda/lambda_api.py | pkjmesra/localstack | 586250f1f26a85fb23793707fec38fcd9b38e3ca | [
"Apache-2.0"
] | null | null | null | localstack/services/awslambda/lambda_api.py | pkjmesra/localstack | 586250f1f26a85fb23793707fec38fcd9b38e3ca | [
"Apache-2.0"
] | null | null | null | import re
import os
import imp
import sys
import json
import uuid
import time
import base64
import logging
import zipfile
import threading
import traceback
import hashlib
from io import BytesIO
from datetime import datetime
from six.moves import cStringIO as StringIO
from six.moves.urllib.parse import urlparse
from fla... | 37.657377 | 119 | 0.653346 | import re
import os
import imp
import sys
import json
import uuid
import time
import base64
import logging
import zipfile
import threading
import traceback
import hashlib
from io import BytesIO
from datetime import datetime
from six.moves import cStringIO as StringIO
from six.moves.urllib.parse import urlparse
from fla... | true | true |
f73af6ddf0f40d493b96b19dc9ea9cef14e39447 | 604 | py | Python | kharidari/shop/migrations/0001_initial.py | priyanshgupta1998/Kharidari--A-Shopping-Site | f0fb74e7bf4de8677c23548e51fc45109195c7ff | [
"MIT"
] | null | null | null | kharidari/shop/migrations/0001_initial.py | priyanshgupta1998/Kharidari--A-Shopping-Site | f0fb74e7bf4de8677c23548e51fc45109195c7ff | [
"MIT"
] | null | null | null | kharidari/shop/migrations/0001_initial.py | priyanshgupta1998/Kharidari--A-Shopping-Site | f0fb74e7bf4de8677c23548e51fc45109195c7ff | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2021-01-02 08:08
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(... | 25.166667 | 114 | 0.566225 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Product',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=... | true | true |
f73af75e17d128397d1226fe21905f18f55d224c | 2,456 | py | Python | surfaces/trianglesDrawing.py | massimo-nocentini/cagd | baec0824951ebc17e23e16e71339dd8fd79b11c2 | [
"MIT"
] | null | null | null | surfaces/trianglesDrawing.py | massimo-nocentini/cagd | baec0824951ebc17e23e16e71339dd8fd79b11c2 | [
"MIT"
] | null | null | null | surfaces/trianglesDrawing.py | massimo-nocentini/cagd | baec0824951ebc17e23e16e71339dd8fd79b11c2 | [
"MIT"
] | null | null | null |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import trianglesCore as tc
def draw(*surfaces, figure_size_tuple=(15,15)):
sizex, sizey = figure_size_tuple
matplotlib.rcParams['figure.figsize'] = [sizex, sizey]
# necessary adjustment if `draw... | 29.590361 | 89 | 0.586726 |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import trianglesCore as tc
def draw(*surfaces, figure_size_tuple=(15,15)):
sizex, sizey = figure_size_tuple
matplotlib.rcParams['figure.figsize'] = [sizex, sizey]
if len(surfaces) is 2 and ... | true | true |
f73af773ca483fd0145380bad75f59373e203edf | 1,110 | py | Python | snips_nlu/__about__.py | theHazzard/snips-nlu | 52714e902bb7baeed4f95bca16719606e6fac5cc | [
"Apache-2.0"
] | 1 | 2020-01-10T00:36:30.000Z | 2020-01-10T00:36:30.000Z | snips_nlu/__about__.py | theHazzard/snips-nlu | 52714e902bb7baeed4f95bca16719606e6fac5cc | [
"Apache-2.0"
] | null | null | null | snips_nlu/__about__.py | theHazzard/snips-nlu | 52714e902bb7baeed4f95bca16719606e6fac5cc | [
"Apache-2.0"
] | null | null | null | # inspired from:
# https://python-packaging-user-guide.readthedocs.io/guides/single-sourcing-package-version/
# https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py
# pylint:disable=line-too-long
__title__ = "snips_nlu"
__summary__ = "Snips Natural Language Understanding library"
__github_url__ = "htt... | 42.692308 | 118 | 0.791892 |
__title__ = "snips_nlu"
__summary__ = "Snips Natural Language Understanding library"
__github_url__ = "https://github.com/snipsco/snips-nlu"
__doc_url__ = "https://snips-nlu.readthedocs.io"
__tracker_url__ = "https://github.com/snipsco/snips-nlu/issues"
__author__ = "Clement Doumouro, Adrien Ball"
__email__ = "cl... | true | true |
f73af796a6da1263483c84ff8775622f02baa36f | 595 | py | Python | blogging_api/models/tag.py | mustafmst/plain-blog | 12a575e9b343c404a64c6a50847e45b9b8680938 | [
"MIT"
] | null | null | null | blogging_api/models/tag.py | mustafmst/plain-blog | 12a575e9b343c404a64c6a50847e45b9b8680938 | [
"MIT"
] | 5 | 2021-03-10T06:39:20.000Z | 2021-09-22T18:39:19.000Z | blogging_api/models/tag.py | mustafmst/plain-blog | 12a575e9b343c404a64c6a50847e45b9b8680938 | [
"MIT"
] | 1 | 2020-03-08T12:20:43.000Z | 2020-03-08T12:20:43.000Z | from django.db import models
from rest_framework import serializers
class Tag(models.Model):
"""
Post tag model
"""
name = models.CharField(max_length=50, unique=True, primary_key=True)
backend_tag = models.BooleanField(default=False)
def __str__(self):
return self.name
class TagSer... | 22.037037 | 73 | 0.685714 | from django.db import models
from rest_framework import serializers
class Tag(models.Model):
name = models.CharField(max_length=50, unique=True, primary_key=True)
backend_tag = models.BooleanField(default=False)
def __str__(self):
return self.name
class TagSerializer(serializers.Serializer):
... | true | true |
f73af7e5966b3ded656c0e5c48f5c329fb3a9f53 | 272 | py | Python | appli/daemon/fourcheball_daemon.py | kasshyss/fourcheball | 12f0312eb32cc2fb247d8a5d8fb6b0b7ea195a32 | [
"MIT"
] | null | null | null | appli/daemon/fourcheball_daemon.py | kasshyss/fourcheball | 12f0312eb32cc2fb247d8a5d8fb6b0b7ea195a32 | [
"MIT"
] | null | null | null | appli/daemon/fourcheball_daemon.py | kasshyss/fourcheball | 12f0312eb32cc2fb247d8a5d8fb6b0b7ea195a32 | [
"MIT"
] | null | null | null |
import pdb
import logging
import m_conf as conf
logging.basicConfig()
logger = logging.getLogger('fourcheball_daemon')
logger.setLevel(conf.get_logger_level())
logger.info('Init daemon')
while True:
logger.debug('Run 1')
raw_input() # dev purpose
sleep(3)
| 17 | 48 | 0.738971 |
import pdb
import logging
import m_conf as conf
logging.basicConfig()
logger = logging.getLogger('fourcheball_daemon')
logger.setLevel(conf.get_logger_level())
logger.info('Init daemon')
while True:
logger.debug('Run 1')
raw_input()
sleep(3)
| true | true |
f73af8f755cc898881f10347c9b52721483b2dc7 | 2,285 | py | Python | cohesity_management_sdk/models/virtual_disk_id.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/virtual_disk_id.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | cohesity_management_sdk/models/virtual_disk_id.py | sachinthakare-cohesity/management-sdk-python | c95f67b7d387d5bab8392be43190e598280ae7b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class VirtualDiskId(object):
"""Implementation of the 'Virtual Disk Id.' model.
Specifies information about virtual disk which includes disk uuid,
controller type, bus number and unit number.
Attributes:
bus_number (long|int): Specifies... | 30.466667 | 81 | 0.609628 |
class VirtualDiskId(object):
_names = {
"bus_number":'busNumber',
"controller_type":'controllerType',
"disk_id":'diskId',
"unit_number":'unitNumber'
}
def __init__(self,
bus_number=None,
controller_type=None,
disk... | true | true |
f73afa5f7826feefd827315c4f21dca04103fde3 | 279 | py | Python | accounts/urls.py | kekeho/nitnc-cancel-notification | ba8bd9f3ed6b7c831b244d6d1cff537f72bf5057 | [
"MIT"
] | 1 | 2018-12-05T13:35:17.000Z | 2018-12-05T13:35:17.000Z | accounts/urls.py | kekeho/nitnc-cancel-notification | ba8bd9f3ed6b7c831b244d6d1cff537f72bf5057 | [
"MIT"
] | 3 | 2020-02-11T23:33:44.000Z | 2021-06-10T21:04:08.000Z | accounts/urls.py | kekeho/NITNC-Cancel-Notification | ba8bd9f3ed6b7c831b244d6d1cff537f72bf5057 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('signup/', views.signup, name='signup'),
path('login/', views.login_func, name='login'),
path('logout/', views.logout_func, name='logout'),
path('profile/', views.profile, name='profile'),
]
| 25.363636 | 54 | 0.659498 | from django.urls import path
from . import views
urlpatterns = [
path('signup/', views.signup, name='signup'),
path('login/', views.login_func, name='login'),
path('logout/', views.logout_func, name='logout'),
path('profile/', views.profile, name='profile'),
]
| true | true |
f73afb0ad5aec3ffcd5866b9178b6da1669735eb | 381 | py | Python | reviewboard/scmtools/evolutions/repository_access_control.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/scmtools/evolutions/repository_access_control.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | reviewboard/scmtools/evolutions/repository_access_control.py | pombredanne/reviewboard | 15f1d7236ec7a5cb4778ebfeb8b45d13a46ac71d | [
"MIT"
] | null | null | null | from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('Repository', 'review_groups', models.ManyToManyField,
related_model='reviews.Group'),
AddField('Repository', 'public', models.BooleanField, initial=True),
AddField('Repository', 'users', model... | 31.75 | 72 | 0.711286 | from django_evolution.mutations import AddField
from django.db import models
MUTATIONS = [
AddField('Repository', 'review_groups', models.ManyToManyField,
related_model='reviews.Group'),
AddField('Repository', 'public', models.BooleanField, initial=True),
AddField('Repository', 'users', model... | true | true |
f73afb40d706a15d509b322556bb628eaa1ba16e | 233 | py | Python | backend/base/serializers.py | mazin123100/ecommerce-app | d93926316cc7ba7647d02e43d4dd065184394966 | [
"MIT"
] | null | null | null | backend/base/serializers.py | mazin123100/ecommerce-app | d93926316cc7ba7647d02e43d4dd065184394966 | [
"MIT"
] | null | null | null | backend/base/serializers.py | mazin123100/ecommerce-app | d93926316cc7ba7647d02e43d4dd065184394966 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Product
class ProductSerializer(serializers.ModelSerializer):
class Meta:
model = Product
fields = '__all__' | 25.888889 | 53 | 0.759657 | from rest_framework import serializers
from django.contrib.auth.models import User
from .models import Product
class ProductSerializer(serializers.ModelSerializer):
class Meta:
model = Product
fields = '__all__' | true | true |
f73afbb3bfe017359420464452f7afee9f7f6cc0 | 2,974 | py | Python | xml_info.py | BenHall-7/MSClang | f85129f5642dc42b1ad3cd7603a0dbc63062ae05 | [
"MIT"
] | null | null | null | xml_info.py | BenHall-7/MSClang | f85129f5642dc42b1ad3cd7603a0dbc63062ae05 | [
"MIT"
] | null | null | null | xml_info.py | BenHall-7/MSClang | f85129f5642dc42b1ad3cd7603a0dbc63062ae05 | [
"MIT"
] | null | null | null | from xml.etree import ElementTree as ET
from enum import Enum
class VariableLabel:
def __init__(self, id=None, name=None):
self.id = id
self.name = name
self.methods = []
def getMethod(self, searchFor):
if type(searchFor) == str:
for method in self.methods:
... | 35.831325 | 72 | 0.515131 | from xml.etree import ElementTree as ET
from enum import Enum
class VariableLabel:
def __init__(self, id=None, name=None):
self.id = id
self.name = name
self.methods = []
def getMethod(self, searchFor):
if type(searchFor) == str:
for method in self.methods:
... | true | true |
f73afc2f3d5ae8fafc1cd7d0a54d0c6049227974 | 4,634 | py | Python | dimod/converters.py | randomir/dimod | 8f636168a620e0dc9d969fb0a813f6b4ba5a755c | [
"Apache-2.0"
] | null | null | null | dimod/converters.py | randomir/dimod | 8f636168a620e0dc9d969fb0a813f6b4ba5a755c | [
"Apache-2.0"
] | null | null | null | dimod/converters.py | randomir/dimod | 8f636168a620e0dc9d969fb0a813f6b4ba5a755c | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.922481 | 80 | 0.594303 |
from dimod.bqm.adjdictbqm import AdjDictBQM
__all__ = ['to_networkx_graph', 'from_networkx_graph']
def to_networkx_graph(bqm,
node_attribute_name='bias',
edge_attribute_name='bias'):
import networkx as nx
BQM = nx.Graph()
BQM.add_nodes_fr... | true | true |
f73afcd0822e7126176eee07d8981a396d91fd93 | 1,693 | py | Python | basic/basic_example1.py | mingewang/pytorch_deep_learning_by_example | 83c9e12364a359b9ef77f0645ca7815e9e817f58 | [
"MIT"
] | 7 | 2019-05-28T11:26:02.000Z | 2020-02-13T18:24:18.000Z | basic/basic_example1.py | mingewang/pytorch_deep_learning_by_example | 83c9e12364a359b9ef77f0645ca7815e9e817f58 | [
"MIT"
] | null | null | null | basic/basic_example1.py | mingewang/pytorch_deep_learning_by_example | 83c9e12364a359b9ef77f0645ca7815e9e817f58 | [
"MIT"
] | 5 | 2019-07-24T18:08:35.000Z | 2021-08-09T01:07:54.000Z | # -*- coding: utf-8 -*-
import torch
# N is batch size; D_in is input dimension;
# H is hidden dimension; D_out is output dimension.
N, D_in, H, D_out = 64, 1000, 100, 10
# Create random Tensors to hold inputs and outputs
x = torch.randn(N, D_in)
y = torch.randn(N, D_out)
# Use the nn package to define our model and... | 33.196078 | 80 | 0.712345 |
import torch
N, D_in, H, D_out = 64, 1000, 100, 10
x = torch.randn(N, D_in)
y = torch.randn(N, D_out)
model = torch.nn.Sequential(
torch.nn.Linear(D_in, H),
torch.nn.ReLU(),
torch.nn.Linear(H, D_out),
)
loss_fn = torch.nn.MSELoss(reduction='sum')
learning_rate = 1e-4
optimizer = torch.optim.Ada... | true | true |
f73afd1e493ad48a2dbdfb848634a13d8e2b0146 | 2,219 | py | Python | build/repo/boost/boost-b2-msvc-invoke.py | fifoforlifo/nstd | 68f5b370e10b2d1e078027ecbc040b7eaa9e08aa | [
"BSL-1.0"
] | null | null | null | build/repo/boost/boost-b2-msvc-invoke.py | fifoforlifo/nstd | 68f5b370e10b2d1e078027ecbc040b7eaa9e08aa | [
"BSL-1.0"
] | null | null | null | build/repo/boost/boost-b2-msvc-invoke.py | fifoforlifo/nstd | 68f5b370e10b2d1e078027ecbc040b7eaa9e08aa | [
"BSL-1.0"
] | null | null | null | import os
import sys
import glob
script, boostDir, vcVer, vcDir, arch, runtimeLink, config, stageDir, logFilePath, guardFileBase, guardFilePath = sys.argv
# For this to work, modify tools\build\v2\tools\msvc.jam with this:
#
# local rule auto-detect-toolset-versions ( )
# {
# # pynja: add explicit control o... | 28.818182 | 227 | 0.639928 | import os
import sys
import glob
script, boostDir, vcVer, vcDir, arch, runtimeLink, config, stageDir, logFilePath, guardFileBase, guardFilePath = sys.argv
] = vcDir
libnames = [
"chrono",
"date_time",
"filesystem",
"locale",
"math",
"program_options",
"r... | true | true |
f73afd385ba51cd16c1bc54bdba73f68de01b930 | 2,979 | py | Python | jesse/modes/import_candles_mode/drivers/binance_futures.py | quantfor/jesse | 0a451132aaaf848b2ed6bcd0efa90d73c04d538d | [
"MIT"
] | null | null | null | jesse/modes/import_candles_mode/drivers/binance_futures.py | quantfor/jesse | 0a451132aaaf848b2ed6bcd0efa90d73c04d538d | [
"MIT"
] | null | null | null | jesse/modes/import_candles_mode/drivers/binance_futures.py | quantfor/jesse | 0a451132aaaf848b2ed6bcd0efa90d73c04d538d | [
"MIT"
] | null | null | null | import requests
import jesse.helpers as jh
from jesse import exceptions
from jesse.modes.import_candles_mode.drivers.interface import CandleExchange
class BinanceFutures(CandleExchange):
def __init__(self) -> None:
# import here instead of the top of the file to prevent possible the circular imports issu... | 32.032258 | 100 | 0.58711 | import requests
import jesse.helpers as jh
from jesse import exceptions
from jesse.modes.import_candles_mode.drivers.interface import CandleExchange
class BinanceFutures(CandleExchange):
def __init__(self) -> None:
from jesse.modes.import_candles_mode.drivers.binance import Binance
supe... | true | true |
f73afd95f26f890041a6a3dff2db4d6fe0c59391 | 16,706 | py | Python | src/skmultiflow/trees/stacked_single_target_hoeffding_tree_regressor.py | lambertsbennett/scikit-multiflow | bc714fd5ee4f0a486adc00ec6ae39eafa64f81cc | [
"BSD-3-Clause"
] | 1 | 2021-06-17T18:46:42.000Z | 2021-06-17T18:46:42.000Z | src/skmultiflow/trees/stacked_single_target_hoeffding_tree_regressor.py | lambertsbennett/scikit-multiflow | bc714fd5ee4f0a486adc00ec6ae39eafa64f81cc | [
"BSD-3-Clause"
] | null | null | null | src/skmultiflow/trees/stacked_single_target_hoeffding_tree_regressor.py | lambertsbennett/scikit-multiflow | bc714fd5ee4f0a486adc00ec6ae39eafa64f81cc | [
"BSD-3-Clause"
] | null | null | null | from operator import attrgetter
import numpy as np
from skmultiflow.core import MultiOutputMixin
from skmultiflow.trees import iSOUPTreeRegressor
from skmultiflow.utils import get_dimensions
from skmultiflow.trees.split_criterion import IntraClusterVarianceReductionSplitCriterion
from skmultiflow.trees.nodes import ... | 44.549333 | 89 | 0.5592 | from operator import attrgetter
import numpy as np
from skmultiflow.core import MultiOutputMixin
from skmultiflow.trees import iSOUPTreeRegressor
from skmultiflow.utils import get_dimensions
from skmultiflow.trees.split_criterion import IntraClusterVarianceReductionSplitCriterion
from skmultiflow.trees.nodes import ... | true | true |
f73afdcad8e818812662d41e891fdcf0eaf1cc95 | 7,622 | py | Python | src/api/bkuser_core/categories/plugins/ldap/adaptor.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/plugins/ldap/adaptor.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | src/api/bkuser_core/categories/plugins/ldap/adaptor.py | Canway-shiisa/bk-user | a049e80d12082960828015742cea4b041f4af796 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-用户管理(Bk-User) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the Lic... | 38.301508 | 119 | 0.66846 |
import logging
from dataclasses import dataclass, field
from typing import Any, Dict, List, NamedTuple, Optional
from django.utils.encoding import force_str
from ldap3.utils import dn as dn_utils
from bkuser_core.categories.plugins.constants import DYNAMIC_FIELDS_SETTING_KEY
from bkuser_core.categories.plugins.ldap.... | true | true |
f73afef58d65deabe13b39d87236bc23035e79be | 1,568 | py | Python | wrappers/python/tests/wallet/test_open_wallet.py | Diiaablo95/indy-sdk | 0ef7321f5902683af928cdc7ea94d522bee33d30 | [
"Apache-2.0"
] | null | null | null | wrappers/python/tests/wallet/test_open_wallet.py | Diiaablo95/indy-sdk | 0ef7321f5902683af928cdc7ea94d522bee33d30 | [
"Apache-2.0"
] | null | null | null | wrappers/python/tests/wallet/test_open_wallet.py | Diiaablo95/indy-sdk | 0ef7321f5902683af928cdc7ea94d522bee33d30 | [
"Apache-2.0"
] | null | null | null | import pytest
from indy import IndyError
from indy import wallet
from indy.error import ErrorCode
@pytest.mark.asyncio
@pytest.mark.parametrize("wallet_config", [None, '{"freshness_time":1000}'])
async def test_open_wallet_works(wallet_config, wallet_handle):
pass
@pytest.mark.asyncio
async def test_open_walle... | 35.636364 | 115 | 0.776148 | import pytest
from indy import IndyError
from indy import wallet
from indy.error import ErrorCode
@pytest.mark.asyncio
@pytest.mark.parametrize("wallet_config", [None, '{"freshness_time":1000}'])
async def test_open_wallet_works(wallet_config, wallet_handle):
pass
@pytest.mark.asyncio
async def test_open_walle... | true | true |
f73b00e0feedd153a750b316f06b75f9098f979e | 6,487 | py | Python | pygdf/buffer.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 5 | 2019-01-15T12:31:49.000Z | 2021-03-05T21:17:13.000Z | pygdf/buffer.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 1 | 2019-06-18T20:58:21.000Z | 2019-06-18T20:58:21.000Z | pygdf/buffer.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | null | null | null |
import numpy as np
from numba import cuda
from . import cudautils, utils
from .serialize import register_distributed_serializer
class Buffer(object):
"""A 1D gpu buffer.
"""
_cached_ipch = None
@classmethod
def from_empty(cls, mem):
"""From empty device array
"""
return ... | 30.313084 | 77 | 0.586712 |
import numpy as np
from numba import cuda
from . import cudautils, utils
from .serialize import register_distributed_serializer
class Buffer(object):
_cached_ipch = None
@classmethod
def from_empty(cls, mem):
return cls(mem, size=0, capacity=mem.size)
@classmethod
def null(cls, dtype):... | true | true |
f73b01975ebb13cdcf0df9646b4dbb50b9335e5a | 51 | py | Python | plugins/holland.backup.pgdump/holland/backup/pgdump/__init__.py | a5a351e7/holland | 58a12a5ce10206eed9434ab42b02217de29784bb | [
"BSD-3-Clause"
] | 1 | 2019-06-06T01:07:34.000Z | 2019-06-06T01:07:34.000Z | plugins/holland.backup.pgdump/holland/backup/pgdump/__init__.py | a5a351e7/holland | 58a12a5ce10206eed9434ab42b02217de29784bb | [
"BSD-3-Clause"
] | null | null | null | plugins/holland.backup.pgdump/holland/backup/pgdump/__init__.py | a5a351e7/holland | 58a12a5ce10206eed9434ab42b02217de29784bb | [
"BSD-3-Clause"
] | 2 | 2015-12-04T12:17:59.000Z | 2022-03-23T07:22:02.000Z | from holland.backup.pgdump.interface import PgDump
| 25.5 | 50 | 0.862745 | from holland.backup.pgdump.interface import PgDump
| true | true |
f73b0279e5d187de3ecac7a5ffeabbd5fe32d864 | 7,205 | py | Python | ResNet-50/SVHN/train.py | GuanlinLee/FPD-for-Adversarial-Robustness | 76b06cb8a68469f8ed4ed6bb5479ee86719175fb | [
"MIT"
] | 11 | 2020-03-16T06:07:14.000Z | 2021-09-08T11:51:23.000Z | ResNet-50/SVHN/train.py | GuanlinLee/FPD-for-Adversarial-Robustness | 76b06cb8a68469f8ed4ed6bb5479ee86719175fb | [
"MIT"
] | 2 | 2020-08-25T06:03:50.000Z | 2021-07-08T03:47:09.000Z | ResNet-50/SVHN/train.py | GuanlinLee/FPD-for-Adversarial-Robustness | 76b06cb8a68469f8ed4ed6bb5479ee86719175fb | [
"MIT"
] | 5 | 2020-03-16T12:29:21.000Z | 2021-12-13T07:32:30.000Z | import torchvision
import torchvision.transforms as transforms
import torch
import torch.utils.data
import resnet
from torch.autograd import Variable
from torch import nn
import early_stop
from tqdm import tqdm
import os,sys
import numpy as np
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
train_globa_step=0
val_globa_ste... | 37.526042 | 105 | 0.54018 | import torchvision
import torchvision.transforms as transforms
import torch
import torch.utils.data
import resnet
from torch.autograd import Variable
from torch import nn
import early_stop
from tqdm import tqdm
import os,sys
import numpy as np
os.environ["CUDA_VISIBLE_DEVICES"] = "2"
train_globa_step=0
val_globa_ste... | true | true |
f73b046b13174e6adabf622521b086d561673104 | 4,362 | py | Python | splunktaucclib/rest_handler/endpoint/__init__.py | splunk/addonfactory-ucc-library | 0c020fc46a38d17fb50614d7bcce840d7ec6af45 | [
"Apache-2.0"
] | 7 | 2021-03-18T23:46:26.000Z | 2021-11-16T13:49:00.000Z | splunktaucclib/rest_handler/endpoint/__init__.py | splunk/addonfactory-ucc-library | 0c020fc46a38d17fb50614d7bcce840d7ec6af45 | [
"Apache-2.0"
] | 103 | 2020-10-21T06:18:29.000Z | 2022-02-14T16:54:47.000Z | splunktaucclib/rest_handler/endpoint/__init__.py | splunk/addonfactory-ucc-library | 0c020fc46a38d17fb50614d7bcce840d7ec6af45 | [
"Apache-2.0"
] | 4 | 2021-03-22T19:39:33.000Z | 2022-03-27T16:52:11.000Z | #
# Copyright 2021 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 25.068966 | 84 | 0.607978 |
from ..error import RestError
from ..util import get_base_app_name
__all__ = [
"RestModel",
"RestEndpoint",
"SingleModel",
"MultipleModel",
"DataInputModel",
]
class RestModel:
def __init__(self, fields, name=None):
self.name = name
self.fields = fields
clas... | true | true |
f73b04b712d5a2f1aec0e5f6bc372f9b99185b6b | 442 | py | Python | wsknn/utils/meta.py | nokaut/wsknn | dd0f0c17d0e212fb47fe6ee283cb90b9d6a5ba25 | [
"BSD-3-Clause"
] | 1 | 2022-03-24T11:48:18.000Z | 2022-03-24T11:48:18.000Z | wsknn/utils/meta.py | nokaut/wsknn | dd0f0c17d0e212fb47fe6ee283cb90b9d6a5ba25 | [
"BSD-3-Clause"
] | 1 | 2022-03-29T08:53:59.000Z | 2022-03-29T08:53:59.000Z | wsknn/utils/meta.py | nokaut/wsknn | dd0f0c17d0e212fb47fe6ee283cb90b9d6a5ba25 | [
"BSD-3-Clause"
] | null | null | null | import yaml
def parse_settings(settings_file: str) -> dict:
"""
The function parses settings file into dict
Parameters
----------
settings_file : str
File with the model settings, must be in yaml.
Returns
-------
ydict : dict
Parsed settings used for m... | 19.217391 | 66 | 0.58371 | import yaml
def parse_settings(settings_file: str) -> dict:
with open(settings_file, 'r') as fstream:
ydict = yaml.safe_load(fstream)
return ydict
| true | true |
f73b0549a8520f8a1b9f80ee2a9d44368bb49989 | 7,159 | py | Python | soaplib/core/zope2.py | divaliu1408/overfit | 083dcfaa758391092933e19544462cd831e73ef0 | [
"Apache-2.0"
] | null | null | null | soaplib/core/zope2.py | divaliu1408/overfit | 083dcfaa758391092933e19544462cd831e73ef0 | [
"Apache-2.0"
] | null | null | null | soaplib/core/zope2.py | divaliu1408/overfit | 083dcfaa758391092933e19544462cd831e73ef0 | [
"Apache-2.0"
] | null | null | null | """Mix-In Class to Export Decorated Methods using SOAP
This file is not a Zope2 Product nor a Zope3 component. It is a simple
Python module that adds two elements: a hook into the Zope publisher to
intercept SOAP requests, and a mix-in class to your Zope2 folder classes
that make them SOAP-aware, with que... | 36.340102 | 89 | 0.69032 | """Mix-In Class to Export Decorated Methods using SOAP
This file is not a Zope2 Product nor a Zope3 component. It is a simple
Python module that adds two elements: a hook into the Zope publisher to
intercept SOAP requests, and a mix-in class to your Zope2 folder classes
that make them SOAP-aware, with que... | false | true |
f73b05b0700c62b63ea3a42beaae70fc2169843b | 1,989 | py | Python | lec1_step3.py | hirowgit/2B3_python_owl_logic_database_course | 81096b287c32a067aa11a9a37ae5a4c6a0d1301e | [
"MIT"
] | 1 | 2020-06-04T23:54:14.000Z | 2020-06-04T23:54:14.000Z | lec1_step3.py | hirowgit/2B3_python_owl_logic_database_course | 81096b287c32a067aa11a9a37ae5a4c6a0d1301e | [
"MIT"
] | null | null | null | lec1_step3.py | hirowgit/2B3_python_owl_logic_database_course | 81096b287c32a067aa11a9a37ae5a4c6a0d1301e | [
"MIT"
] | 1 | 2020-10-14T04:20:44.000Z | 2020-10-14T04:20:44.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
## Python basics for novice data scientists, supported by Wagatsuma Lab@Kyutech
#
# The MIT License (MIT): Copyright (c) 2020 Hiroaki Wagatsuma and Wagatsuma Lab@Kyutech
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software ... | 29.25 | 465 | 0.726998 | true | true | |
f73b06530db80bbe588f75d2af60bc804b0df596 | 22,815 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/pceperosubobjectslist_7ea27079d1a1d53cebc6e1e83b2ca0b4.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/pceperosubobjectslist_7ea27079d1a1d53cebc6e1e83b2ca0b4.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/pceperosubobjectslist_7ea27079d1a1d53cebc6e1e83b2ca0b4.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 42.328386 | 529 | 0.652509 |
from uhd_restpy.base import Base
from uhd_restpy.files import Files
from typing import List, Any, Union
class PcepEroSubObjectsList(Base):
__slots__ = ()
_SDM_NAME = 'pcepEroSubObjectsList'
_SDM_ATT_MAP = {
'Active': 'active',
'AsNumber': 'asNumber',
'Bos': 'b... | true | true |
f73b07c81484deadd67f88b7cda2aebdf3fd7843 | 2,734 | py | Python | vader/vader-web.py | cherdt/vader-webform | 16caa59e9f86134652f164b7795d8d3a41b30725 | [
"MIT"
] | null | null | null | vader/vader-web.py | cherdt/vader-webform | 16caa59e9f86134652f164b7795d8d3a41b30725 | [
"MIT"
] | 3 | 2020-03-20T16:53:30.000Z | 2020-03-21T22:43:18.000Z | vader/vader-web.py | cherdt/vader-webform | 16caa59e9f86134652f164b7795d8d3a41b30725 | [
"MIT"
] | null | null | null | import json
import nltk.data
from flask import Flask
from flask import escape
from flask import Markup
from flask import render_template
from flask import request
#from flask import send_static_file
from flask_cors import CORS
from nltk.sentiment.vader import SentimentIntensityAnalyzer
app = Flask(__name__)
CORS(app)
... | 25.551402 | 151 | 0.653987 | import json
import nltk.data
from flask import Flask
from flask import escape
from flask import Markup
from flask import render_template
from flask import request
from flask_cors import CORS
from nltk.sentiment.vader import SentimentIntensityAnalyzer
app = Flask(__name__)
CORS(app)
splitter = nltk.data.load('tokeniz... | true | true |
f73b08ee4fee92e19f3eb5047268d576244f59e9 | 1,831 | py | Python | setup.py | WnP/pysass | ba9b949e2ee68f58bd4840a3ae91bd401ebe0253 | [
"MIT"
] | null | null | null | setup.py | WnP/pysass | ba9b949e2ee68f58bd4840a3ae91bd401ebe0253 | [
"MIT"
] | 1 | 2019-03-08T10:33:34.000Z | 2019-03-19T13:52:46.000Z | setup.py | WnP/pysass | ba9b949e2ee68f58bd4840a3ae91bd401ebe0253 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# read the contents of your README file
from os import path
from setuptools import setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="pysas... | 36.62 | 73 | 0.630257 |
from os import path
from setuptools import setup
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="pysass",
description="Sass CLI Python: "
"A wrapper to libsass-python with watch... | true | true |
f73b0a5cbdc2ead38b5e63e1f96b962ddb083520 | 3,792 | py | Python | shrdlu_blocks/demo.py | hosford42/SHRDLUBlocks | 8f847f2dd3a258318c418c15ebc6233827da9c27 | [
"MIT"
] | 1 | 2021-08-30T10:31:32.000Z | 2021-08-30T10:31:32.000Z | shrdlu_blocks/demo.py | hosford42/SHRDLUBlocks | 8f847f2dd3a258318c418c15ebc6233827da9c27 | [
"MIT"
] | null | null | null | shrdlu_blocks/demo.py | hosford42/SHRDLUBlocks | 8f847f2dd3a258318c418c15ebc6233827da9c27 | [
"MIT"
] | 1 | 2022-01-08T19:43:02.000Z | 2022-01-08T19:43:02.000Z | """
A simple demo of the environment.
Usage:
python3 -m shrdlu_blocks.demo
The environment will be displayed in a graphics window. The user can type
various commands into the graphics window to query the scene and control the
grasper. Type `help` to get a list of commands.
"""
import ast
import io
import logging... | 34.472727 | 99 | 0.638449 |
import ast
import io
import logging
import traceback
import pygame.display
from shrdlu_blocks.control import Controller
from shrdlu_blocks.scenes import PhysicalObject
from shrdlu_blocks.typedefs import UnmetConditionError, ObjectID
from shrdlu_blocks.viewer import Viewer
__all__ = ['demo']
def demo_callback(contr... | true | true |
f73b0a84dd68da3e5ac508e5df1cfc14043f82d0 | 866 | py | Python | mp4box/parsing/mdhd.py | abhijeetbhagat/mp4box | 841ff0ef70c7f5a96548f47414bba69c00aa2f5e | [
"BSD-3-Clause"
] | 7 | 2019-08-14T03:03:51.000Z | 2021-11-14T19:10:00.000Z | mp4box/parsing/mdhd.py | wanyhamo/mp4box | c5c73cd37c01bd9d637f1f3ed82221065dc86d6f | [
"BSD-3-Clause"
] | 10 | 2019-08-03T16:27:08.000Z | 2019-09-10T10:05:23.000Z | mp4box/parsing/mdhd.py | abhijeetbhagat/mp4box | 841ff0ef70c7f5a96548f47414bba69c00aa2f5e | [
"BSD-3-Clause"
] | 7 | 2019-08-19T17:58:03.000Z | 2021-03-03T07:25:54.000Z | from mp4box.box import MediaHeaderBox
def parse_mdhd(reader, my_size):
version = reader.read32()
box = MediaHeaderBox(my_size, version, 0)
if version == 0:
box.creation_time = reader.read32()
box.modification_time = reader.read32()
box.timescale = reader.read32()
... | 30.928571 | 52 | 0.572748 | from mp4box.box import MediaHeaderBox
def parse_mdhd(reader, my_size):
version = reader.read32()
box = MediaHeaderBox(my_size, version, 0)
if version == 0:
box.creation_time = reader.read32()
box.modification_time = reader.read32()
box.timescale = reader.read32()
... | true | true |
f73b0aea61f411d235153b75fb33290b07c86cb8 | 7,176 | py | Python | azure-mgmt-web/azure/mgmt/web/operations/deleted_web_apps_operations.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure-mgmt-web/azure/mgmt/web/operations/deleted_web_apps_operations.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure-mgmt-web/azure/mgmt/web/operations/deleted_web_apps_operations.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:17:41.000Z | 2018-11-09T06:17:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 41.964912 | 173 | 0.627926 |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
import uuid
from .. import models
class DeletedWebAppsOperations(object):
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer... | true | true |
f73b0b1daf4e0dc9eeaea3df01a84fbe271845de | 2,654 | py | Python | var/spack/repos/builtin/packages/gnutls/package.py | SimeonEhrig/spack | 7fe0230492ecf0e497a84d578ea163570cf460eb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/gnutls/package.py | SimeonEhrig/spack | 7fe0230492ecf0e497a84d578ea163570cf460eb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/gnutls/package.py | SimeonEhrig/spack | 7fe0230492ecf0e497a84d578ea163570cf460eb | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Gnutls(AutotoolsPackage):
"""GnuTLS is a secure communications library implementing the SS... | 35.864865 | 96 | 0.625094 |
from spack import *
class Gnutls(AutotoolsPackage):
homepage = "http://www.gnutls.org"
url = "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.5/gnutls-3.5.19.tar.xz"
version('3.5.19', sha256='1936eb64f03aaefd6eb16cef0567457777618573826b94d03376bb6a4afadc44')
version('3.5.13', '4fd41ad86572933c2... | true | true |
f73b0bd7e116e1a33ca2a85d3f8e31715bb61138 | 3,209 | py | Python | ML/China_daily/apriori.py | PiscesDream/Ideas | 9ba710e62472f183ae4525f35659cd265c71392e | [
"Apache-2.0"
] | null | null | null | ML/China_daily/apriori.py | PiscesDream/Ideas | 9ba710e62472f183ae4525f35659cd265c71392e | [
"Apache-2.0"
] | null | null | null | ML/China_daily/apriori.py | PiscesDream/Ideas | 9ba710e62472f183ae4525f35659cd265c71392e | [
"Apache-2.0"
] | null | null | null | from pprint import pprint
class Apriori(object):
def __init__(self, data, minSupport = 0.7, minConf = 0.5):
def calcConf(freqSet, H, supD, ans):
prunedH = []
for conseq in H:
conf = supD[freqSet] / supD[freqSet - conseq]
if conf >= minCo... | 30.561905 | 62 | 0.426301 | from pprint import pprint
class Apriori(object):
def __init__(self, data, minSupport = 0.7, minConf = 0.5):
def calcConf(freqSet, H, supD, ans):
prunedH = []
for conseq in H:
conf = supD[freqSet] / supD[freqSet - conseq]
if conf >= minCo... | false | true |
f73b0c922f4cce44c12d31dcb1e553205a57ad87 | 591 | py | Python | sig-backend/api/routes/beach_routes.py | antonioalfa22/sig-playas-asturias | 3cc087d44a0dc7cdc932adbc9e877a4b53fcff93 | [
"MIT"
] | 1 | 2020-12-01T19:53:14.000Z | 2020-12-01T19:53:14.000Z | sig-backend/api/routes/beach_routes.py | antonioalfa22/sig-playas-asturias | 3cc087d44a0dc7cdc932adbc9e877a4b53fcff93 | [
"MIT"
] | null | null | null | sig-backend/api/routes/beach_routes.py | antonioalfa22/sig-playas-asturias | 3cc087d44a0dc7cdc932adbc9e877a4b53fcff93 | [
"MIT"
] | null | null | null | from flask_cors import cross_origin
from flask import request, jsonify
from flask import current_app as app
from api.controllers.beach_controller import BeachController
@app.route('/api/beaches', methods=['GET'])
@cross_origin()
def get_all_beaches():
return jsonify(BeachController.get_all_beaches())
@app.route... | 25.695652 | 60 | 0.766497 | from flask_cors import cross_origin
from flask import request, jsonify
from flask import current_app as app
from api.controllers.beach_controller import BeachController
@app.route('/api/beaches', methods=['GET'])
@cross_origin()
def get_all_beaches():
return jsonify(BeachController.get_all_beaches())
@app.route... | true | true |
f73b0d4790f474cdb8909c630dc85fc514afe8e3 | 260 | py | Python | evaluateModel.py | rdv0011/egoHands-coreML | c8c8c12606bc63da7538d23b45e76c59896324bc | [
"Apache-2.0"
] | 1 | 2020-07-10T13:39:50.000Z | 2020-07-10T13:39:50.000Z | evaluateModel.py | rdv0011/egoHands-coreML | c8c8c12606bc63da7538d23b45e76c59896324bc | [
"Apache-2.0"
] | null | null | null | evaluateModel.py | rdv0011/egoHands-coreML | c8c8c12606bc63da7538d23b45e76c59896324bc | [
"Apache-2.0"
] | null | null | null | import turicreate as tc
# Inferring using original Darknet-YOLO model
handsModel = tc.load_model('Hands')
# Evaluate the model and save the results into a dictionary
test_data = tc.SFrame('test.sframe')
metrics = handsModel.evaluate(test_data)
print(metrics) | 32.5 | 59 | 0.792308 | import turicreate as tc
handsModel = tc.load_model('Hands')
test_data = tc.SFrame('test.sframe')
metrics = handsModel.evaluate(test_data)
print(metrics) | true | true |
f73b0e94279f49e57277e260bb12a026414d16d5 | 4,575 | py | Python | CoProcessing/Adaptors/CamAdaptor/fv_coprocess.py | JamesLinus/ParaView | d0dd28e0527c230044f1891db2d8ad0170a04af0 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2019-04-22T09:09:18.000Z | 2019-04-22T09:09:18.000Z | CoProcessing/Adaptors/CamAdaptor/fv_coprocess.py | JamesLinus/ParaView | d0dd28e0527c230044f1891db2d8ad0170a04af0 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | CoProcessing/Adaptors/CamAdaptor/fv_coprocess.py | JamesLinus/ParaView | d0dd28e0527c230044f1891db2d8ad0170a04af0 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from paraview.simple import *
from paraview import coprocessing
#--------------------------------------------------------------
# Code generated from cpstate.py to create the CoProcessor.
# ParaView 4.2.0-15-g46ac001 64 bits
# ----------------------- CoProcessor definition -----------------------
def CreateCoProce... | 40.486726 | 83 | 0.657049 | from paraview.simple import *
from paraview import coprocessing
def CreateCoProcessor():
def _CreatePipeline(coprocessor, datadescription):
class Pipeline:
h02DWriter = servermanager.writers.XMLPUnstructuredGridWriter(Input=h02D)
h02DWriter.FileName = 'h02... | false | true |
f73b0eedb205f1a9ea3d5b6b7908dd63ab43f23e | 222 | py | Python | old-regressions/python/tst12.py | muchang/z3test | e3e7739f98b7aa85427fcb8a39a4c675132a896e | [
"MIT"
] | 23 | 2015-04-20T08:51:00.000Z | 2021-11-15T12:20:59.000Z | old-regressions/python/tst12.py | muchang/z3test | e3e7739f98b7aa85427fcb8a39a4c675132a896e | [
"MIT"
] | 18 | 2016-03-02T15:17:42.000Z | 2021-12-16T22:10:05.000Z | old-regressions/python/tst12.py | muchang/z3test | e3e7739f98b7aa85427fcb8a39a4c675132a896e | [
"MIT"
] | 30 | 2015-05-30T15:29:17.000Z | 2022-02-25T15:58:58.000Z |
# Copyright (c) 2015 Microsoft Corporation
from z3 import *
x = Real('x')
y = Real('y')
g = Goal()
g.add(x > 10, y == x + 1)
g.add(y > 1)
print Probe('num-consts')(g)
print Probe('size')(g)
print Probe('num-exprs')(g)
| 15.857143 | 42 | 0.599099 |
from z3 import *
x = Real('x')
y = Real('y')
g = Goal()
g.add(x > 10, y == x + 1)
g.add(y > 1)
print Probe('num-consts')(g)
print Probe('size')(g)
print Probe('num-exprs')(g)
| false | true |
f73b0f3100f9f71347c305e32138d653a727e52a | 2,734 | py | Python | src/services/scadaApiFetcher.py | nagasudhirpulla/wrldc_scada_mumbai_dashboard | bc107ef47568781b588316f0c5c0c0d2a08adac8 | [
"MIT"
] | null | null | null | src/services/scadaApiFetcher.py | nagasudhirpulla/wrldc_scada_mumbai_dashboard | bc107ef47568781b588316f0c5c0c0d2a08adac8 | [
"MIT"
] | null | null | null | src/services/scadaApiFetcher.py | nagasudhirpulla/wrldc_scada_mumbai_dashboard | bc107ef47568781b588316f0c5c0c0d2a08adac8 | [
"MIT"
] | null | null | null | import requests
import json
import datetime as dt
from typing import Dict, Union, List, Optional
from src.typeDefs.scadaApiDataSample import IScadaApiDataSample
import pandas as pd
import random
class ScadaApiFetcher():
apiHost: str = ''
apiPort: int = 80
isDummyFetch: bool = False
def __init__(self,... | 39.057143 | 168 | 0.572056 | import requests
import json
import datetime as dt
from typing import Dict, Union, List, Optional
from src.typeDefs.scadaApiDataSample import IScadaApiDataSample
import pandas as pd
import random
class ScadaApiFetcher():
apiHost: str = ''
apiPort: int = 80
isDummyFetch: bool = False
def __init__(self,... | true | true |
f73b10152eedec8dc9da2a71c37cdddeaabec1ad | 974 | py | Python | server/lib/python3.9/site-packages/stripe/api_resources/transfer.py | ejanicas-stripe/hotel | a0d0a7e1ae14b509a5c9d05d17603b99399cb752 | [
"MIT"
] | 1,078 | 2015-01-06T03:35:05.000Z | 2022-03-25T13:25:48.000Z | server/lib/python3.9/site-packages/stripe/api_resources/transfer.py | ejanicas-stripe/hotel | a0d0a7e1ae14b509a5c9d05d17603b99399cb752 | [
"MIT"
] | 558 | 2015-01-07T19:05:02.000Z | 2022-03-28T22:19:24.000Z | server/lib/python3.9/site-packages/stripe/api_resources/transfer.py | ejanicas-stripe/hotel | a0d0a7e1ae14b509a5c9d05d17603b99399cb752 | [
"MIT"
] | 382 | 2015-01-04T14:06:09.000Z | 2022-03-16T04:52:04.000Z | # File generated from our OpenAPI spec
from __future__ import absolute_import, division, print_function
from stripe import util
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.abstract import UpdateableAPIResource
f... | 33.586207 | 71 | 0.774127 |
from __future__ import absolute_import, division, print_function
from stripe import util
from stripe.api_resources.abstract import CreateableAPIResource
from stripe.api_resources.abstract import ListableAPIResource
from stripe.api_resources.abstract import UpdateableAPIResource
from stripe.api_resources.abstract impo... | true | true |
f73b109eb879d68cf4a557550deb9ff69b20173b | 770 | py | Python | examples/session_hello_world.py | 13751742405/photoshop-python-api | 5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70 | [
"MIT"
] | null | null | null | examples/session_hello_world.py | 13751742405/photoshop-python-api | 5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70 | [
"MIT"
] | null | null | null | examples/session_hello_world.py | 13751742405/photoshop-python-api | 5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70 | [
"MIT"
] | null | null | null | """Add slate information dynamically."""
import os
from tempfile import mkdtemp
from photoshop import Session
with Session() as adobe:
doc = adobe.app.documents.add(2000, 2000)
text_color = adobe.SolidColor()
text_color.rgb.red = 255
new_text_layer = doc.artLayers.add()
new_text_layer.kind = adob... | 35 | 79 | 0.72987 |
import os
from tempfile import mkdtemp
from photoshop import Session
with Session() as adobe:
doc = adobe.app.documents.add(2000, 2000)
text_color = adobe.SolidColor()
text_color.rgb.red = 255
new_text_layer = doc.artLayers.add()
new_text_layer.kind = adobe.LayerKind.TextLayer
new_text_layer.... | true | true |
f73b131b5b91a24c4796a66ea31210ff751b8e6a | 436 | py | Python | app/feeds.py | sunxr9/django-blog-scrapy | b881765ecbc16448245b22e1f5caa6288a1fb9b4 | [
"MIT"
] | null | null | null | app/feeds.py | sunxr9/django-blog-scrapy | b881765ecbc16448245b22e1f5caa6288a1fb9b4 | [
"MIT"
] | null | null | null | app/feeds.py | sunxr9/django-blog-scrapy | b881765ecbc16448245b22e1f5caa6288a1fb9b4 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from django.contrib.syndication.views import Feed
from .models import Article
class AllArticleRssFeed(Feed):
title = '个人博客'
link = '/'
# 需要显示的条目
def items(self):
return Article.objects.all()[:5]
# 显示内容的标题
def item_title(self, item):
return '[%s] %s'... | 19.818182 | 54 | 0.616972 |
from django.contrib.syndication.views import Feed
from .models import Article
class AllArticleRssFeed(Feed):
title = '个人博客'
link = '/'
def items(self):
return Article.objects.all()[:5]
def item_title(self, item):
return '[%s] %s' % (item.category, item.title)
de... | true | true |
f73b135fa8d38e86b878e4334911df84ffe15d1d | 8,616 | py | Python | RL/soft_actor.py | ksluck/Coadaptation | aa16f277cd31c324a62c832ef2cef94e28d598b8 | [
"MIT"
] | 9 | 2019-11-21T05:21:19.000Z | 2022-02-18T02:16:25.000Z | RL/soft_actor.py | ksluck/Coadaptation | aa16f277cd31c324a62c832ef2cef94e28d598b8 | [
"MIT"
] | 3 | 2020-07-31T13:34:34.000Z | 2021-09-02T07:33:22.000Z | RL/soft_actor.py | ksluck/Coadaptation | aa16f277cd31c324a62c832ef2cef94e28d598b8 | [
"MIT"
] | 5 | 2020-06-04T19:36:59.000Z | 2022-01-04T12:30:10.000Z | from rlkit.torch.sac.policies import TanhGaussianPolicy
# from rlkit.torch.sac.sac import SoftActorCritic
from rlkit.torch.networks import FlattenMlp
import numpy as np
from .rl_algorithm import RL_algorithm
from rlkit.torch.sac.sac import SACTrainer as SoftActorCritic_rlkit
import rlkit.torch.pytorch_util as ptu
impor... | 37.955947 | 119 | 0.638812 | from rlkit.torch.sac.policies import TanhGaussianPolicy
from rlkit.torch.networks import FlattenMlp
import numpy as np
from .rl_algorithm import RL_algorithm
from rlkit.torch.sac.sac import SACTrainer as SoftActorCritic_rlkit
import rlkit.torch.pytorch_util as ptu
import torch
import utils
class SoftActorCritic(RL_a... | true | true |
f73b13c9474f958b46c5b34dc9999dcabc90129f | 6,066 | py | Python | bin/Player.py | nic-olo/Pac-Man | 381b5fef8c674d06f649b63be5619cb273a74064 | [
"MIT"
] | null | null | null | bin/Player.py | nic-olo/Pac-Man | 381b5fef8c674d06f649b63be5619cb273a74064 | [
"MIT"
] | null | null | null | bin/Player.py | nic-olo/Pac-Man | 381b5fef8c674d06f649b63be5619cb273a74064 | [
"MIT"
] | null | null | null | from settings import *
from MazeRender import coin_collision
from time import time
class Player:
def __init__(self, app):
"""initialize the player"""
self.app = app
self.player_color = self.app.settings['color']
self.player_speed = PLAYER_SPEED
self.make_player()
se... | 38.636943 | 78 | 0.509397 | from settings import *
from MazeRender import coin_collision
from time import time
class Player:
def __init__(self, app):
self.app = app
self.player_color = self.app.settings['color']
self.player_speed = PLAYER_SPEED
self.make_player()
self.prev_time = time()
def make_... | true | true |
f73b14df601281b19ccb257989a917da8b3ff5b2 | 2,677 | py | Python | Currency Convertor - GUI based/Currency_convertor_GUI.py | avinashkranjan/PraticalPythonProjects | 12c1f7cedae57a843ceb6aba68cca48df505f341 | [
"MIT"
] | 930 | 2020-09-05T22:07:28.000Z | 2022-03-30T07:56:18.000Z | Currency Convertor - GUI based/Currency_convertor_GUI.py | maheshdbabar9340/Amazing-Python-Scripts | e2272048cbe49b4bda5072bbdd8479739bb6c18d | [
"MIT"
] | 893 | 2020-09-04T07:57:24.000Z | 2022-02-08T02:12:26.000Z | Currency Convertor - GUI based/Currency_convertor_GUI.py | maheshdbabar9340/Amazing-Python-Scripts | e2272048cbe49b4bda5072bbdd8479739bb6c18d | [
"MIT"
] | 497 | 2020-09-05T08:16:24.000Z | 2022-03-31T00:55:57.000Z | import requests
import tkinter as tk
from tkinter import ttk
def calculate_conversion():
# URL of respective API
url = "https://api.exchangerate-api.com/v4/latest/INR"
# Receive Data from API
data = requests.get(url).json()
currency_rates = data['rates']
# get From amount from GUI
amount... | 31.869048 | 97 | 0.668659 | import requests
import tkinter as tk
from tkinter import ttk
def calculate_conversion():
url = "https://api.exchangerate-api.com/v4/latest/INR"
data = requests.get(url).json()
currency_rates = data['rates']
amount = float(from_amount.get())
fc = from_currency_code.get()
... | true | true |
f73b14f39ab08ab4d7861586f6d0ef7f537d17f9 | 85 | py | Python | pydip/player/__init__.py | leo26k/pydip | dd849ed8c74d87eae6a509bc6357bc7ffd296426 | [
"MIT"
] | 13 | 2018-04-04T02:48:59.000Z | 2020-09-13T09:38:24.000Z | pydip/player/__init__.py | leo26k/pydip | dd849ed8c74d87eae6a509bc6357bc7ffd296426 | [
"MIT"
] | 6 | 2018-06-24T19:52:37.000Z | 2021-02-11T20:13:58.000Z | pydip/player/__init__.py | leo26k/pydip | dd849ed8c74d87eae6a509bc6357bc7ffd296426 | [
"MIT"
] | 5 | 2018-02-28T21:03:46.000Z | 2022-03-25T15:58:27.000Z | from pydip.player.player import Player
from pydip.player.unit import UnitTypes, Unit
| 28.333333 | 45 | 0.835294 | from pydip.player.player import Player
from pydip.player.unit import UnitTypes, Unit
| true | true |
f73b15a9ae3a0bc96541c2cb745590141feadb87 | 550 | py | Python | MetioTube/profiles/migrations/0003_profile_subscribers.py | Sheko1/MetioTube | c1c36d00ea46fc37cc7f3c0c9c0cae6e89b2113c | [
"MIT"
] | null | null | null | MetioTube/profiles/migrations/0003_profile_subscribers.py | Sheko1/MetioTube | c1c36d00ea46fc37cc7f3c0c9c0cae6e89b2113c | [
"MIT"
] | null | null | null | MetioTube/profiles/migrations/0003_profile_subscribers.py | Sheko1/MetioTube | c1c36d00ea46fc37cc7f3c0c9c0cae6e89b2113c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-02 10:10
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('profiles', '0002_alter_profile_profile_picture'),
]
... | 26.190476 | 98 | 0.672727 |
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('profiles', '0002_alter_profile_profile_picture'),
]
operations = [
migrations.AddField(... | true | true |
f73b16b6fb215b937be73f7106ede2ed01c01058 | 4,053 | py | Python | sgtpy/vrmie_mixtures/density_solver.py | MatKie/SGTPy | 8e98d92fedd2b07d834e547e5154ec8f70d80728 | [
"MIT"
] | 12 | 2020-12-27T17:04:33.000Z | 2021-07-19T06:28:28.000Z | sgtpy/vrmie_mixtures/density_solver.py | MatKie/SGTPy | 8e98d92fedd2b07d834e547e5154ec8f70d80728 | [
"MIT"
] | 2 | 2021-05-15T14:27:57.000Z | 2021-08-19T15:42:24.000Z | sgtpy/vrmie_mixtures/density_solver.py | MatKie/SGTPy | 8e98d92fedd2b07d834e547e5154ec8f70d80728 | [
"MIT"
] | 5 | 2021-02-21T01:33:29.000Z | 2021-07-26T15:11:08.000Z | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import minimize_scalar, brentq
from ..constants import Na
def dPsaft_fun(rho, x, temp_aux, saft):
rhomolecular = Na * rho
global Xass
da, Xass = saft.d2afcn_drho_aux(x, rhomolecular, temp_aux, Xass)
... | 28.95 | 78 | 0.55243 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.optimize import minimize_scalar, brentq
from ..constants import Na
def dPsaft_fun(rho, x, temp_aux, saft):
rhomolecular = Na * rho
global Xass
da, Xass = saft.d2afcn_drho_aux(x, rhomolecular, temp_aux, Xass)
... | true | true |
f73b16d4661501fd2f3412b2566c9b04393dbe8e | 1,609 | py | Python | src/huobi/huobi_ws_factory.py | EzePze/l3_data_collection | ec147fec0308f83b479878bc93ed6111aa0f5ea2 | [
"MIT"
] | 1 | 2022-01-28T11:41:55.000Z | 2022-01-28T11:41:55.000Z | src/huobi/huobi_ws_factory.py | EzePze/l3_data_collection | ec147fec0308f83b479878bc93ed6111aa0f5ea2 | [
"MIT"
] | null | null | null | src/huobi/huobi_ws_factory.py | EzePze/l3_data_collection | ec147fec0308f83b479878bc93ed6111aa0f5ea2 | [
"MIT"
] | null | null | null | from websocket_manager import WebsocketManager
class HuobiWsManagerFactory():
def get_ws_manager(self, symbol: str):
"""Jay"""
book_url = "wss://api-aws.huobi.pro/feed"
trades_url = 'wss://api-aws.huobi.pro/ws'
# Subscribe to channels
def subscribe_book(ws_manager):
... | 30.942308 | 93 | 0.572405 | from websocket_manager import WebsocketManager
class HuobiWsManagerFactory():
def get_ws_manager(self, symbol: str):
book_url = "wss://api-aws.huobi.pro/feed"
trades_url = 'wss://api-aws.huobi.pro/ws'
def subscribe_book(ws_manager):
request = {'sub': f'market.{symbol}... | true | true |
f73b175257de4b4e2c28386e0fbbb8b6ba20c386 | 3,956 | py | Python | align_rudder/run_eight_alignrudder.py | ml-jku/align-rudder | 26cf4b62a713e180063cefc2921981484ebb9165 | [
"MIT"
] | 12 | 2020-09-30T08:15:44.000Z | 2021-12-22T03:36:33.000Z | align_rudder/run_eight_alignrudder.py | ml-jku/align-rudder | 26cf4b62a713e180063cefc2921981484ebb9165 | [
"MIT"
] | null | null | null | align_rudder/run_eight_alignrudder.py | ml-jku/align-rudder | 26cf4b62a713e180063cefc2921981484ebb9165 | [
"MIT"
] | 1 | 2020-12-09T21:33:28.000Z | 2020-12-09T21:33:28.000Z | import ray
from ray import tune
import gym
from align_rudder.learning.q_learning import Qlearning
import numpy as np
import random
import os
import pkg_resources
import shutil
config = {
'env_id': 'align_rudder:EightRooms-v0', # environment for the experiment
'exp_name': 'align-rudder', # name of the experim... | 43.955556 | 115 | 0.653943 | import ray
from ray import tune
import gym
from align_rudder.learning.q_learning import Qlearning
import numpy as np
import random
import os
import pkg_resources
import shutil
config = {
'env_id': 'align_rudder:EightRooms-v0',
'exp_name': 'align-rudder',
'gamma': 1.0,
'total_timesteps': 10000000,... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.