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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3b08af7c3dc096936c3528aa09cebaf722275b | 1,980 | py | Python | house_price_mlp.py | starcroce/tf_dl_cookbook | 65c0cb9c9df230e551df5f04c5e2345dcbe53552 | [
"MIT"
] | null | null | null | house_price_mlp.py | starcroce/tf_dl_cookbook | 65c0cb9c9df230e551df5f04c5e2345dcbe53552 | [
"MIT"
] | null | null | null | house_price_mlp.py | starcroce/tf_dl_cookbook | 65c0cb9c9df230e551df5f04c5e2345dcbe53552 | [
"MIT"
] | 1 | 2019-01-02T06:42:36.000Z | 2019-01-02T06:42:36.000Z | import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.layers as layers
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
boston = datasets.load_boston()
df = pd.DataFrame(boston.data, columns... | 33 | 84 | 0.717677 | import matplotlib.pyplot as plt
import pandas as pd
import tensorflow as tf
import tensorflow.contrib.layers as layers
from sklearn import datasets
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import MinMaxScaler
boston = datasets.load_boston()
df = pd.DataFrame(boston.data, columns... | true | true |
1c3b0913d27b99b70bf2d48e73a0e8605d912f7e | 277 | py | Python | whyis/blueprint/nanopub/__init__.py | tolulomo/whyis | eb50ab3301eb7efd27a1a3f6fb2305dedd910397 | [
"Apache-2.0"
] | 31 | 2018-05-30T02:41:23.000Z | 2021-10-17T01:25:20.000Z | whyis/blueprint/nanopub/__init__.py | tolulomo/whyis | eb50ab3301eb7efd27a1a3f6fb2305dedd910397 | [
"Apache-2.0"
] | 115 | 2018-04-07T00:59:11.000Z | 2022-03-02T03:06:45.000Z | whyis/blueprint/nanopub/__init__.py | tolulomo/whyis | eb50ab3301eb7efd27a1a3f6fb2305dedd910397 | [
"Apache-2.0"
] | 25 | 2018-04-07T00:49:55.000Z | 2021-09-28T14:29:18.000Z | from .nanopub_blueprint import nanopub_blueprint
from .delete_nanopub import delete_nanopub as __delete_nanopub
from .get_nanopub import get_nanopub as __get_nanopub
from .post_nanopub import post_nanopub as __post_nanopub
from .put_nanopub import put_nanopub as __put_nanopub
| 46.166667 | 62 | 0.880866 | from .nanopub_blueprint import nanopub_blueprint
from .delete_nanopub import delete_nanopub as __delete_nanopub
from .get_nanopub import get_nanopub as __get_nanopub
from .post_nanopub import post_nanopub as __post_nanopub
from .put_nanopub import put_nanopub as __put_nanopub
| true | true |
1c3b09d840e3ffbc3af67b126048f4eaf366fa05 | 11,294 | py | Python | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | cogdl/pipelines.py | zhangdan0602/cogdl | 35a338f29066e4b1a5d7f46217f09ebceaf13106 | [
"MIT"
] | null | null | null | import os
import random
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from numpy.lib.arraysetops import isin
import torch
import yaml
from grave import plot_network, use_attributes
from tabulate import tabulate
from cogdl import oagbert
from cogdl.data import Grap... | 36.668831 | 118 | 0.600673 | import os
import random
import matplotlib.cm as cm
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
from numpy.lib.arraysetops import isin
import torch
import yaml
from grave import plot_network, use_attributes
from tabulate import tabulate
from cogdl import oagbert
from cogdl.data import Grap... | true | true |
1c3b09daa52dd6908eb9f534be81ec1437d867aa | 18,070 | py | Python | tests/unit/scm/test_git.py | larsmelcher/dvc | 71bae7e4affbc5f37aceb9412dd60822201a942d | [
"Apache-2.0"
] | 1 | 2019-10-04T13:46:03.000Z | 2019-10-04T13:46:03.000Z | tests/unit/scm/test_git.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | 32 | 2021-10-21T17:14:55.000Z | 2022-03-31T17:18:19.000Z | tests/unit/scm/test_git.py | Indraji-Ushantha/dvc | cfcb7e12942d826c0c84c01966c0a47483b1d618 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from dvc.scm.base import SCMError
# Behaves the same as SCM but will test against all supported Git backends.
# tmp_dir.scm will still contain a default SCM instance.
@pytest.fixture(params=["gitpython", "dulwich", "pygit2"])
def git(tmp_dir, scm, request):
from dvc.scm.git import Git
... | 30.994854 | 78 | 0.603154 | import os
import pytest
from dvc.scm.base import SCMError
@pytest.fixture(params=["gitpython", "dulwich", "pygit2"])
def git(tmp_dir, scm, request):
from dvc.scm.git import Git
git_ = Git(os.fspath(tmp_dir), backends=[request.param])
git_.test_backend = request.param
yield git_
git_.close()
@... | true | true |
1c3b0a5e82ed0aa464b3dca8e0a8d8ba63c5bbca | 1,347 | py | Python | curtains/stepper_driver.py | KevinMidboe/curtains_avantGarde | ad991518fd5465c479c2257a3f58d07d9038d59f | [
"MIT"
] | null | null | null | curtains/stepper_driver.py | KevinMidboe/curtains_avantGarde | ad991518fd5465c479c2257a3f58d07d9038d59f | [
"MIT"
] | null | null | null | curtains/stepper_driver.py | KevinMidboe/curtains_avantGarde | ad991518fd5465c479c2257a3f58d07d9038d59f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author: KevinMidboe
# @Date: 2017-08-25 16:04:49
# @Last Modified by: KevinMidboe
# @Last Modified time: 2017-08-25 17:34:07
from time import sleep
import RPi.GPIO as gpio
class Stepper:
# Initiate stepper
# Pins = [pin1, pin2, pin3, pin4]
def __init__(self, pi... | 19.521739 | 59 | 0.646622 |
from time import sleep
import RPi.GPIO as gpio
class Stepper:
def __init__(self, pins):
self.pins = pins
gpio.setmode(gpio.BCM)
for pin in self.pins:
gpio.setup(pin, gpio.OUT)
gpio.output(pin, False)
def cleanGPIO(self):
gpio.cleanup()
def rotate(self, l, n=1):
return l[n:] + l[:n]
def tog... | true | true |
1c3b0b21cd525f8bf44163e71c6a22d31c564b40 | 5,240 | py | Python | marconi/openstack/common/cache/_backends/memory.py | andrew-vant/marconi | 9afe7ba27efe597cca8baac77fd0aa387c75001a | [
"Apache-2.0"
] | null | null | null | marconi/openstack/common/cache/_backends/memory.py | andrew-vant/marconi | 9afe7ba27efe597cca8baac77fd0aa387c75001a | [
"Apache-2.0"
] | null | null | null | marconi/openstack/common/cache/_backends/memory.py | andrew-vant/marconi | 9afe7ba27efe597cca8baac77fd0aa387c75001a | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Red Hat, 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 agre... | 31.566265 | 78 | 0.589885 |
import collections
from marconi.openstack.common.cache import backends
from marconi.openstack.common import lockutils
from marconi.openstack.common import timeutils
class MemoryBackend(backends.BaseCache):
def __init__(self, parsed_url, options=None):
super(MemoryBackend, self).__init__(parsed_url, opt... | true | true |
1c3b0be6de73d7cc06657e6f2db94f3125f6786a | 38 | py | Python | tests/dataframe_creation_test.py | mmutiso/dea | 6c497b05ef2e957b610a2f9390a3d55d69bcaa7d | [
"Apache-2.0"
] | null | null | null | tests/dataframe_creation_test.py | mmutiso/dea | 6c497b05ef2e957b610a2f9390a3d55d69bcaa7d | [
"Apache-2.0"
] | 1 | 2022-01-01T17:33:13.000Z | 2022-01-01T17:33:13.000Z | tests/dataframe_creation_test.py | mmutiso/dea | 6c497b05ef2e957b610a2f9390a3d55d69bcaa7d | [
"Apache-2.0"
] | null | null | null | def test_default():
assert True
| 12.666667 | 20 | 0.657895 | def test_default():
assert True
| true | true |
1c3b0c024441448637d709c8de20e8cccda5be38 | 108 | py | Python | whatpulse/config.py | beenotung/whatpulse | 56d2e16b989f8b0be80f41134ab82688bf90bdd9 | [
"MIT"
] | 33 | 2016-02-01T15:17:18.000Z | 2021-09-04T21:21:59.000Z | whatpulse/config.py | beenotung/whatpulse | 56d2e16b989f8b0be80f41134ab82688bf90bdd9 | [
"MIT"
] | 9 | 2016-05-30T12:48:52.000Z | 2020-08-12T23:36:10.000Z | whatpulse/config.py | beenotung/whatpulse | 56d2e16b989f8b0be80f41134ab82688bf90bdd9 | [
"MIT"
] | 8 | 2016-02-01T15:14:37.000Z | 2020-09-23T09:42:29.000Z | client_version = '2.8.1'
type_os = 'linux' # windows, linux, macos
__all__ = ["client_version", "type_os"]
| 21.6 | 41 | 0.685185 | client_version = '2.8.1'
type_os = 'linux'
__all__ = ["client_version", "type_os"]
| true | true |
1c3b0d2fb3fb9e1f8591c15f4f718e00532f5e15 | 1,456 | py | Python | paper_result/MINet/bicon/train/utils/tensor_ops.py | Zyun-Y/BiconNets | f5ea85dc58550969b99a2ccccccd8133dda4358c | [
"MIT"
] | 9 | 2021-03-02T05:16:03.000Z | 2022-02-01T07:47:00.000Z | paper_result/MINet/bicon/train/utils/tensor_ops.py | Zyun-Y/BiconNets | f5ea85dc58550969b99a2ccccccd8133dda4358c | [
"MIT"
] | null | null | null | paper_result/MINet/bicon/train/utils/tensor_ops.py | Zyun-Y/BiconNets | f5ea85dc58550969b99a2ccccccd8133dda4358c | [
"MIT"
] | 2 | 2021-08-10T07:30:01.000Z | 2021-11-22T03:01:50.000Z | # -*- coding: utf-8 -*-
import torch.nn.functional as F
def cus_sample(feat, **kwargs):
"""
:param feat: 输入特征
:param kwargs: size或者scale_factor
"""
assert len(kwargs.keys()) == 1 and list(kwargs.keys())[0] in ["size", "scale_factor"]
return F.interpolate(feat, **kwargs, mode="bilinear", align... | 25.103448 | 93 | 0.570055 |
import torch.nn.functional as F
def cus_sample(feat, **kwargs):
assert len(kwargs.keys()) == 1 and list(kwargs.keys())[0] in ["size", "scale_factor"]
return F.interpolate(feat, **kwargs, mode="bilinear", align_corners=False)
def upsample_add(*xs):
y = xs[-1]
for x in xs[:-1]:
y = y + F.inte... | true | true |
1c3b0de3f094a179e48a574a148643a328b237d7 | 2,449 | py | Python | olea/packages/json_api/json_api/conditions.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 2 | 2020-06-18T03:25:52.000Z | 2020-06-18T07:33:45.000Z | olea/packages/json_api/json_api/conditions.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 15 | 2021-01-28T07:11:04.000Z | 2021-05-24T07:11:37.000Z | olea/packages/json_api/json_api/conditions.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict
class BaseCondition():
def gen_schema(self, field_type, schema) -> Dict[str, Any]:
pass
class AnyValue(BaseCondition):
def gen_schema(self, field_type, schema):
return schema
class Regex(BaseCondition):
def __init__(self, pattern):
self.pattern = pa... | 26.333333 | 91 | 0.588812 | from typing import Any, Dict
class BaseCondition():
def gen_schema(self, field_type, schema) -> Dict[str, Any]:
pass
class AnyValue(BaseCondition):
def gen_schema(self, field_type, schema):
return schema
class Regex(BaseCondition):
def __init__(self, pattern):
self.pattern = pa... | true | true |
1c3b0e3649ccf6bc24793ef5e8f21581e122af57 | 6,443 | py | Python | stylebank/datasets.py | ncassereau-idris/stylebank | 2884d5eb8175622a03684ee621fd44736a431e82 | [
"MIT"
] | null | null | null | stylebank/datasets.py | ncassereau-idris/stylebank | 2884d5eb8175622a03684ee621fd44736a431e82 | [
"MIT"
] | null | null | null | stylebank/datasets.py | ncassereau-idris/stylebank | 2884d5eb8175622a03684ee621fd44736a431e82 | [
"MIT"
] | null | null | null | # /usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
from hydra.utils import to_absolute_path
import torch
import torch.distributed as dist
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torchvision.transforms.functional as TF
from torchvisi... | 30.535545 | 79 | 0.624864 |
import logging
from hydra.utils import to_absolute_path
import torch
import torch.distributed as dist
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.distributed import DistributedSampler
import torchvision.transforms.functional as TF
from torchvision.io import read_image
import torchvision.tran... | true | true |
1c3b0eb236deebcb953e7906a54e6acab54f1c15 | 2,500 | py | Python | tests/events.py | msabramo/chaperone | 9ff2c3a5b9c6820f8750320a564ea214042df06f | [
"Apache-2.0"
] | 186 | 2015-07-22T00:08:04.000Z | 2021-11-05T21:51:09.000Z | tests/events.py | msabramo/chaperone | 9ff2c3a5b9c6820f8750320a564ea214042df06f | [
"Apache-2.0"
] | 24 | 2015-07-27T15:30:14.000Z | 2021-09-11T21:19:37.000Z | tests/events.py | msabramo/chaperone | 9ff2c3a5b9c6820f8750320a564ea214042df06f | [
"Apache-2.0"
] | 26 | 2016-01-11T21:02:30.000Z | 2021-08-31T11:09:25.000Z | from prefix import *
from chaperone.cutil.events import EventSource
class handlers:
def __init__(self):
self.results = list()
def handler1(self, val):
self.results.append("handler1:" + val)
def handler2(self, val):
self.results.append("handler2:" + val)
def handler3(sel... | 39.0625 | 162 | 0.614 | from prefix import *
from chaperone.cutil.events import EventSource
class handlers:
def __init__(self):
self.results = list()
def handler1(self, val):
self.results.append("handler1:" + val)
def handler2(self, val):
self.results.append("handler2:" + val)
def handler3(sel... | true | true |
1c3b0f72301a9ab5af61f59e6bbc9d5259041a3d | 1,302 | py | Python | djangocms_file/migrations/0006_migrate_to_filer.py | crydotsnake/djangocms-file | 044bc86545493493227d2393cea475e23759478c | [
"BSD-3-Clause"
] | 25 | 2015-10-24T20:37:23.000Z | 2020-09-24T12:02:35.000Z | djangocms_file/migrations/0006_migrate_to_filer.py | crydotsnake/djangocms-file | 044bc86545493493227d2393cea475e23759478c | [
"BSD-3-Clause"
] | 40 | 2015-03-23T16:17:34.000Z | 2020-09-02T08:30:44.000Z | djangocms_file/migrations/0006_migrate_to_filer.py | crydotsnake/djangocms-file | 044bc86545493493227d2393cea475e23759478c | [
"BSD-3-Clause"
] | 17 | 2015-08-18T17:41:03.000Z | 2020-02-11T23:42:00.000Z | import django.db.models.deletion
from django.db import migrations, models
import filer.fields.file
def migrate_to_filer(apps, schema_editor):
# Because filer is polymorphic, Djangos migration can't handle
from filer.models import File
FileInstance = apps.get_model('djangocms_file', 'File')
plugins = ... | 30.27907 | 176 | 0.615207 | import django.db.models.deletion
from django.db import migrations, models
import filer.fields.file
def migrate_to_filer(apps, schema_editor):
from filer.models import File
FileInstance = apps.get_model('djangocms_file', 'File')
plugins = FileInstance.objects.all()
for plugin in plugins: # pragm... | true | true |
1c3b0f88c705ffdd66629d61b72914e4eb0d5a7a | 43,116 | py | Python | lights.py | caj380/lifx-lan-gui | 610f1cea7c915dd6d9c2d5108a1c5a19309527f2 | [
"MIT"
] | null | null | null | lights.py | caj380/lifx-lan-gui | 610f1cea7c915dd6d9c2d5108a1c5a19309527f2 | [
"MIT"
] | null | null | null | lights.py | caj380/lifx-lan-gui | 610f1cea7c915dd6d9c2d5108a1c5a19309527f2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
if sys.version_info < (3, 3):
sys.stdout.write("Sorry, This module requires Python 3.3 (or higher), not Python 2.x. You are using Python {0}.{1}\n".format(sys.version_info[0],sys.version_info[1]))
sys.exit(1)
from appJar import gui
import os
import time
import binascii
im... | 34.548077 | 347 | 0.618193 |
import sys
if sys.version_info < (3, 3):
sys.stdout.write("Sorry, This module requires Python 3.3 (or higher), not Python 2.x. You are using Python {0}.{1}\n".format(sys.version_info[0],sys.version_info[1]))
sys.exit(1)
from appJar import gui
import os
import time
import binascii
import lifxlan
import col... | true | true |
1c3b0fd15cdb829b31c47e897d0ef87b98cab386 | 3,472 | py | Python | IoTSocketServer/iot_logger.py | senceryazici/iot-socket-application-nodemcu | 41449fbfd345bca40ea140011a33b34fe00a3029 | [
"MIT"
] | null | null | null | IoTSocketServer/iot_logger.py | senceryazici/iot-socket-application-nodemcu | 41449fbfd345bca40ea140011a33b34fe00a3029 | [
"MIT"
] | null | null | null | IoTSocketServer/iot_logger.py | senceryazici/iot-socket-application-nodemcu | 41449fbfd345bca40ea140011a33b34fe00a3029 | [
"MIT"
] | null | null | null | import logging
import time
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
# The background is set with 40 plus the number of the color, and the foreground with 30
# These are the sequences need to get colored ouput
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def formatter_... | 33.066667 | 107 | 0.635657 | import logging
import time
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8)
RESET_SEQ = "\033[0m"
COLOR_SEQ = "\033[1;%dm"
BOLD_SEQ = "\033[1m"
def formatter_message(message, use_color=True):
if use_color:
message = message.replace("$RESET", RESET_SEQ).replace("$BOLD", BOLD_SEQ)
els... | true | true |
1c3b101548134ebcc6df1626e2c04c463e13c2e3 | 405 | py | Python | backend/quadrict_30065/wsgi.py | crowdbotics-apps/quadrict-30065 | f214ef8583b95ead2dcb36eb652a60ace7670a3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/quadrict_30065/wsgi.py | crowdbotics-apps/quadrict-30065 | f214ef8583b95ead2dcb36eb652a60ace7670a3b | [
"FTL",
"AML",
"RSA-MD"
] | 13 | 2021-08-30T01:19:08.000Z | 2021-10-05T18:55:12.000Z | backend/quadrict_30065/wsgi.py | crowdbotics-apps/quadrict-30065 | f214ef8583b95ead2dcb36eb652a60ace7670a3b | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for quadrict_30065 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'quadrict_30065.settings')
application = get_wsgi_application()
| true | true |
1c3b102f0650f6539202d916746b5ca4a49f734e | 4,773 | py | Python | 04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py | hustcxl/tensorflow_cookbook | 26673fe74eb9c9eb0824e2dfdf5ef3090bf09a57 | [
"MIT"
] | 93 | 2018-05-27T08:07:02.000Z | 2022-02-28T11:18:08.000Z | 04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py | tensorzhangzheng/tensorflow_cookbook | 4f57ea4ad79c8111fb29bad3da5d151858c6a050 | [
"MIT"
] | null | null | null | 04_Support_Vector_Machines/02_Working_with_Linear_SVMs/02_linear_svm.py | tensorzhangzheng/tensorflow_cookbook | 4f57ea4ad79c8111fb29bad3da5d151858c6a050 | [
"MIT"
] | 75 | 2018-06-22T08:02:03.000Z | 2022-03-10T14:38:44.000Z | # Linear Support Vector Machine: Soft Margin
# ----------------------------------
#
# This function shows how to use TensorFlow to
# create a soft margin SVM
#
# We will use the iris data, specifically:
# x1 = Sepal Length
# x2 = Petal Width
# Class 1 : I. setosa
# Class -1: not I. setosa
#
# We know here that x and ... | 29.645963 | 106 | 0.691599 |
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from sklearn import datasets
from tensorflow.python.framework import ops
ops.reset_default_graph()
np.random.seed(7)
tf.set_random_seed(7)
sess = tf.Session()
iris = datasets.load_iris()
x_vals = np.array([[x[0], x[3]] for x in iris.data])
y... | true | true |
1c3b10e4010c29804569e7af288359aa014a8e66 | 662 | py | Python | sila_cetoni/motioncontrol/axis/sila/axis_service/generated/axissystemcontrolservice/__init__.py | CETONI-Software/sila_cetoni_motioncontrol | d216c7f673eabe9fdba7833fd476330a5b0ef782 | [
"BSD-3-Clause"
] | 1 | 2022-03-08T13:39:52.000Z | 2022-03-08T13:39:52.000Z | sila_cetoni/motioncontrol/axis/sila/axis_service/generated/axissystemcontrolservice/__init__.py | CETONI-Software/sila_cetoni_motioncontrol | d216c7f673eabe9fdba7833fd476330a5b0ef782 | [
"BSD-3-Clause"
] | null | null | null | sila_cetoni/motioncontrol/axis/sila/axis_service/generated/axissystemcontrolservice/__init__.py | CETONI-Software/sila_cetoni_motioncontrol | d216c7f673eabe9fdba7833fd476330a5b0ef782 | [
"BSD-3-Clause"
] | null | null | null | # Generated by sila2.code_generator; sila2.__version__: 0.8.0
from .axissystemcontrolservice_base import AxisSystemControlServiceBase
from .axissystemcontrolservice_client import AxisSystemControlServiceClient
from .axissystemcontrolservice_feature import AxisSystemControlServiceFeature
from .axissystemcontrolservice_t... | 34.842105 | 77 | 0.833837 | from .axissystemcontrolservice_base import AxisSystemControlServiceBase
from .axissystemcontrolservice_client import AxisSystemControlServiceClient
from .axissystemcontrolservice_feature import AxisSystemControlServiceFeature
from .axissystemcontrolservice_types import (
ClearFaultState_Responses,
DisableAxisSy... | true | true |
1c3b113d2ea69701dba48af5b1f804af8611acd0 | 416 | py | Python | filestorage/migrations/0002_auto_20200618_1223.py | AlexGolovaschenko/OwenAgriculture | 4d393da3736d0a71b1d25b720ed16af38013b682 | [
"Apache-2.0"
] | null | null | null | filestorage/migrations/0002_auto_20200618_1223.py | AlexGolovaschenko/OwenAgriculture | 4d393da3736d0a71b1d25b720ed16af38013b682 | [
"Apache-2.0"
] | 7 | 2021-03-19T03:36:56.000Z | 2022-01-13T02:44:37.000Z | filestorage/migrations/0002_auto_20200618_1223.py | AlexGolovaschenko/OwenAgriculture | 4d393da3736d0a71b1d25b720ed16af38013b682 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.6 on 2020-06-18 09:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filestorage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='file',
name='file',
f... | 21.894737 | 91 | 0.59375 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filestorage', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='file',
name='file',
field=models.FileField(upload_to='filestorage/%Y/... | true | true |
1c3b11844b45ea5660db5b77a3b02ff5a2712589 | 11,063 | py | Python | numpy/__init__.py | ruppysuppy/numpy | a89f3ebaec7441f4ba5e30eb07206c2a7269778e | [
"BSD-3-Clause"
] | 2 | 2022-02-02T05:40:47.000Z | 2022-03-05T11:04:24.000Z | numpy/__init__.py | ruppysuppy/numpy | a89f3ebaec7441f4ba5e30eb07206c2a7269778e | [
"BSD-3-Clause"
] | null | null | null | numpy/__init__.py | ruppysuppy/numpy | a89f3ebaec7441f4ba5e30eb07206c2a7269778e | [
"BSD-3-Clause"
] | null | null | null | """
NumPy
=====
Provides
1. An array object of arbitrary homogeneous items
2. Fast mathematical operations over arrays
3. Linear Algebra, Fourier Transforms, Random Number Generation
How to use the documentation
----------------------------
Documentation is available in two forms: docstrings provided
with the c... | 35.687097 | 104 | 0.65823 | import sys
import warnings
from ._globals import ModuleDeprecationWarning, VisibleDeprecationWarning
from ._globals import _NoValue
# procedure itself in a reliable manner.
try:
__NUMPY_SETUP__
except NameError:
__NUMPY_SETUP__ = False
if __NUMPY_SETUP__:
sys.stderr.write('Running from numpy source direc... | true | true |
1c3b11e76c61005bee3f7ce49c5ed0618c32d9a9 | 8,309 | py | Python | tests/core/contracts/test_contract_constructor.py | ConnorMac/web3.py | c7fb8c91a93ce82286922440e236721719d50a98 | [
"MIT"
] | null | null | null | tests/core/contracts/test_contract_constructor.py | ConnorMac/web3.py | c7fb8c91a93ce82286922440e236721719d50a98 | [
"MIT"
] | null | null | null | tests/core/contracts/test_contract_constructor.py | ConnorMac/web3.py | c7fb8c91a93ce82286922440e236721719d50a98 | [
"MIT"
] | null | null | null | import pytest
from eth_utils import (
decode_hex,
)
TEST_ADDRESS = '0x16D9983245De15E7A9A73bC586E01FF6E08dE737'
EXPECTED_DATA_A = 1234
EXPECTED_DATA_B = (b'abcd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
def test_contr... | 39.379147 | 96 | 0.736912 | import pytest
from eth_utils import (
decode_hex,
)
TEST_ADDRESS = '0x16D9983245De15E7A9A73bC586E01FF6E08dE737'
EXPECTED_DATA_A = 1234
EXPECTED_DATA_B = (b'abcd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
def test_contr... | true | true |
1c3b11ea2dde509958ffa5d9fd6bbe510a6e9170 | 2,327 | py | Python | autotest/gdrivers/ngsgeoid.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | 1 | 2018-12-19T14:08:20.000Z | 2018-12-19T14:08:20.000Z | autotest/gdrivers/ngsgeoid.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | null | null | null | autotest/gdrivers/ngsgeoid.py | ajolma/gdal | 19d847c8519919fcd1e7e7247644d28771034317 | [
"MIT"
] | 1 | 2019-11-01T15:17:09.000Z | 2019-11-01T15:17:09.000Z | #!/usr/bin/env pytest
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for NGSGEOID driver.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
##############################################... | 42.309091 | 147 | 0.629996 |
import gdaltest
def test_ngsgeoid_1():
tst = gdaltest.GDALTest('NGSGEOID', 'g2009u01_le_truncated.bin', 1, 65534)
return tst.testOpen(check_gt=(229.99166666666667, 0.016666666666670001, 0.0, 40.00833333333334, 0.0, -0.016666666666670001), check_prj='WGS84')
def test_ngsgeoid_2():
tst = gdaltest.G... | true | true |
1c3b125f2097520071768470165b007e704b4733 | 1,597 | py | Python | package/spack-py-functools32/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-py-functools32/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-py-functools32/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 44.361111 | 89 | 0.678147 | from spack import *
class PyFunctools32(PythonPackage):
homepage = "https://github.com/MiCHiLU/python-functools32"
url = "https://pypi.io/packages/source/f/functools32/functools32-3.2.3-2.tar.gz"
version('3.2.3-2', '09f24ffd9af9f6cd0f63cb9f4e23d4b2')
| true | true |
1c3b127d4fb57402793e5f094a3c33d525524685 | 3,950 | py | Python | networkx/algorithms/tree/tests/test_coding.py | ChrisKeefe/networkx | 66cc88193e5be96f866adac2ef4ccdbe55bab335 | [
"BSD-3-Clause"
] | 1 | 2021-12-10T18:55:32.000Z | 2021-12-10T18:55:32.000Z | networkx/algorithms/tree/tests/test_coding.py | Reed-CompBio/networkx | c266c4b29699290333dff5440e3c9e3029ec0341 | [
"BSD-3-Clause"
] | null | null | null | networkx/algorithms/tree/tests/test_coding.py | Reed-CompBio/networkx | c266c4b29699290333dff5440e3c9e3029ec0341 | [
"BSD-3-Clause"
] | null | null | null | """Unit tests for the :mod:`~networkx.algorithms.tree.coding` module."""
from itertools import product
import pytest
import networkx as nx
from networkx.utils import nodes_equal, edges_equal
class TestPruferSequence:
"""Unit tests for the Prüfer sequence encoding and decoding
functions.
"""
def tes... | 34.955752 | 74 | 0.587342 | from itertools import product
import pytest
import networkx as nx
from networkx.utils import nodes_equal, edges_equal
class TestPruferSequence:
def test_nontree(self):
with pytest.raises(nx.NotATree):
G = nx.cycle_graph(3)
nx.to_prufer_sequence(G)
def test_null_graph(self):
... | true | true |
1c3b1290a5f5a149f55700f326f5cd4656d70e80 | 507 | py | Python | photos/urls.py | Alvin-21/gallery | c121fb50581328cde082459c5adab27df9d57ed6 | [
"Unlicense"
] | null | null | null | photos/urls.py | Alvin-21/gallery | c121fb50581328cde082459c5adab27df9d57ed6 | [
"Unlicense"
] | null | null | null | photos/urls.py | Alvin-21/gallery | c121fb50581328cde082459c5adab27df9d57ed6 | [
"Unlicense"
] | null | null | null | from django.urls import path, re_path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
re_path(r'^$', views.index, name='homepage'),
re_path(r'^image/(\d+)', views.view_image, name='image'),
re_path(r'^categories/', views.search_categories, nam... | 36.214286 | 80 | 0.731755 | from django.urls import path, re_path
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
re_path(r'^$', views.index, name='homepage'),
re_path(r'^image/(\d+)', views.view_image, name='image'),
re_path(r'^categories/', views.search_categories, nam... | true | true |
1c3b1312076676887ced2aceae880c7d66ff9ffb | 7,212 | py | Python | scripts/eda_script.py | Sukriti1312/DSCI-522_City_of_A-Stars_310 | 3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad | [
"MIT"
] | null | null | null | scripts/eda_script.py | Sukriti1312/DSCI-522_City_of_A-Stars_310 | 3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad | [
"MIT"
] | 47 | 2020-01-17T00:42:37.000Z | 2020-02-13T00:09:00.000Z | scripts/eda_script.py | Sukriti1312/DSCI-522_City_of_A-Stars_310 | 3cbfd1c238a86bcc4c3ddeb4d4cf83b90310e4ad | [
"MIT"
] | 3 | 2020-01-17T01:22:59.000Z | 2020-01-18T23:42:32.000Z | # author: A. Muhammad
# date: 2020-02-01
'''This script performs EDA on the students performance datasets
for portuguese and math students and outputs necessary tables and
figures to path provided.
Usage: eda_script.py --file_path=<file_path> --results_path=<results_path>
Example:
python scripts/eda_script.py -... | 35.009709 | 106 | 0.57848 |
import pandas as pd
import numpy as np
from docopt import docopt
import altair as alt
import re
import os
opt = docopt(__doc__)
def test_function():
file_path_check = re.match("([A-Za-z]+[.]{1}[A-Za-z]+)", opt["--file_path"])
out_path_check = re.match("([A-Za-z]+[.]{1}[A-Za-z]+)", opt["--results_path"])
... | true | true |
1c3b13ee68807c4a9242c0e6b8c68380acb5bdd8 | 4,522 | py | Python | userbot/modules/snips.py | hanuraiga/gabot-3 | 31885f3f1f0c57548fa709f4523818925bf4e2ab | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2019-08-12T11:59:48.000Z | 2019-08-12T11:59:48.000Z | userbot/modules/snips.py | arraqueen/userbot | 0e405f2d6b20ceed8e5edd6e77980081d61bc5b7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/snips.py | arraqueen/userbot | 0e405f2d6b20ceed8e5edd6e77980081d61bc5b7 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-03-26T10:48:43.000Z | 2020-03-26T10:48:43.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module containing commands for keeping global notes. """
from userbot.events import register
from userbot im... | 35.328125 | 109 | 0.610128 |
from userbot.events import register
from userbot import CMD_HELP, BOTLOG_CHATID
@register(outgoing=True,
pattern=r"\$\w*",
ignore_unsafe=True,
disable_errors=True)
async def on_snip(event):
try:
from userbot.modules.sql_helper.snips_sql import get_snip
except AttributeEr... | true | true |
1c3b152240d277003e63796921f3238bacc0ddb1 | 109 | py | Python | addmoneyMatt.py | rkelly07/dkekeg | bfface42939c825641d2c5135d91d628ea079ad7 | [
"MIT"
] | null | null | null | addmoneyMatt.py | rkelly07/dkekeg | bfface42939c825641d2c5135d91d628ea079ad7 | [
"MIT"
] | null | null | null | addmoneyMatt.py | rkelly07/dkekeg | bfface42939c825641d2c5135d91d628ea079ad7 | [
"MIT"
] | null | null | null | import DBAccessor
dbaccessor = DBAccessor.DBAccessor()
dbaccessor.updateBalance("172 165 182 203",1000.00)
| 18.166667 | 51 | 0.798165 | import DBAccessor
dbaccessor = DBAccessor.DBAccessor()
dbaccessor.updateBalance("172 165 182 203",1000.00)
| true | true |
1c3b15dce145b18cc68dcfe927d12d0d41f8ac84 | 9,921 | py | Python | piecrust/configuration.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | piecrust/configuration.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | piecrust/configuration.py | airbornemint/PieCrust2 | bd8e44a1a3ba646a9ebfbb4d4f1fa01a1daa3beb | [
"Apache-2.0"
] | null | null | null | import re
import logging
import collections
import collections.abc
import yaml
from yaml.constructor import ConstructorError
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
logger = logging.getLogger(__name__)
default_allowed_types = (dict, list, tuple, float, ... | 30.62037 | 87 | 0.602056 | import re
import logging
import collections
import collections.abc
import yaml
from yaml.constructor import ConstructorError
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
logger = logging.getLogger(__name__)
default_allowed_types = (dict, list, tuple, float, ... | true | true |
1c3b15ea2713c8f46b54b18b22d0365b0ad1f460 | 62,964 | py | Python | sympy/integrals/manualintegrate.py | ricopicone/sympy | de27c97214d540247a35c8215c7920e9a46b54ed | [
"BSD-3-Clause"
] | 2 | 2019-02-05T19:20:24.000Z | 2019-04-23T13:24:38.000Z | sympy/integrals/manualintegrate.py | ricopicone/sympy | de27c97214d540247a35c8215c7920e9a46b54ed | [
"BSD-3-Clause"
] | null | null | null | sympy/integrals/manualintegrate.py | ricopicone/sympy | de27c97214d540247a35c8215c7920e9a46b54ed | [
"BSD-3-Clause"
] | 1 | 2019-10-15T10:55:42.000Z | 2019-10-15T10:55:42.000Z | """Integration method that emulates by-hand techniques.
This module also provides functionality to get the steps used to evaluate a
particular integral, in the ``integral_steps`` function. This will return
nested namedtuples representing the integration rules used. The
``manualintegrate`` function computes the integra... | 37.998793 | 136 | 0.596373 | from __future__ import print_function, division
from collections import namedtuple, defaultdict
import sympy
from sympy.core.compatibility import reduce, Mapping, iterable
from sympy.core.containers import Dict
from sympy.core.logic import fuzzy_not
from sympy.functions.elementary.trigonometric import TrigonometricF... | true | true |
1c3b16400ef2d32f5767944d9dafca6e9323cbf2 | 1,528 | py | Python | vendor/github.com/elastic/beats/metricbeat/scripts/fields_collector.py | PPACI/krakenbeat | e75ec8f006164acb8a57d0c9609bebe534955813 | [
"Apache-2.0"
] | 3 | 2018-01-04T19:15:26.000Z | 2020-02-20T03:35:27.000Z | vendor/github.com/elastic/beats/metricbeat/scripts/fields_collector.py | PPACI/krakenbeat | e75ec8f006164acb8a57d0c9609bebe534955813 | [
"Apache-2.0"
] | null | null | null | vendor/github.com/elastic/beats/metricbeat/scripts/fields_collector.py | PPACI/krakenbeat | e75ec8f006164acb8a57d0c9609bebe534955813 | [
"Apache-2.0"
] | 1 | 2020-10-11T14:57:48.000Z | 2020-10-11T14:57:48.000Z | import os
# Collects fields for all modules and metricset
def collect():
base_dir = "module"
path = os.path.abspath("module")
# yml file
fields_yml = ""
# Iterate over all modules
for module in sorted(os.listdir(base_dir)):
module_fields = path + "/" + module + "/_... | 28.296296 | 91 | 0.522906 | import os
def collect():
base_dir = "module"
path = os.path.abspath("module")
fields_yml = ""
for module in sorted(os.listdir(base_dir)):
module_fields = path + "/" + module + "/_meta/fields.yml"
if os.path.isfile(module_fields) == False:
... | true | true |
1c3b1647485da720eaeab997c19ab32646c50bab | 1,501 | py | Python | main.py | ajp-A/altsniffer | 6a45a4a8b63aaa05610f3414d4fdd5f0bea90f86 | [
"MIT"
] | null | null | null | main.py | ajp-A/altsniffer | 6a45a4a8b63aaa05610f3414d4fdd5f0bea90f86 | [
"MIT"
] | null | null | null | main.py | ajp-A/altsniffer | 6a45a4a8b63aaa05610f3414d4fdd5f0bea90f86 | [
"MIT"
] | null | null | null | import beautifulsoup4 as bs4
import requests as rq
html_site = rq.get("https://www.poxnora.com/trader/listtrades.do?service=trader/listtrades.do")
soup = BeautifulSoup(html_site, 'html.parser')
if __name__ == '__main__':
main()
"""from bs4 import BeautifulSoup
from os import path
from sys import exit
import pan... | 30.02 | 95 | 0.660893 | import beautifulsoup4 as bs4
import requests as rq
html_site = rq.get("https://www.poxnora.com/trader/listtrades.do?service=trader/listtrades.do")
soup = BeautifulSoup(html_site, 'html.parser')
if __name__ == '__main__':
main()
| true | true |
1c3b16c69b0c5704668f2afab4edc623fff685bf | 5,324 | py | Python | tests/index_test.py | DubeySandeep/pending-review-notification | 353fa74d98eeb6c8386818273a2fe02af39d6b9d | [
"Apache-2.0"
] | null | null | null | tests/index_test.py | DubeySandeep/pending-review-notification | 353fa74d98eeb6c8386818273a2fe02af39d6b9d | [
"Apache-2.0"
] | null | null | null | tests/index_test.py | DubeySandeep/pending-review-notification | 353fa74d98eeb6c8386818273a2fe02af39d6b9d | [
"Apache-2.0"
] | 1 | 2021-10-20T16:24:04.000Z | 2021-10-20T16:24:04.000Z | """Unit test for the index.py file."""
import unittest
from datetime import datetime, timedelta, timezone
import json
from unittest.mock import patch, mock_open
import requests_mock
from src import index
from src import github_services
class ModuleIntegerationTest(unittest.TestCase):
"""Integeration test for th... | 35.493333 | 79 | 0.523666 |
import unittest
from datetime import datetime, timedelta, timezone
import json
from unittest.mock import patch, mock_open
import requests_mock
from src import index
from src import github_services
class ModuleIntegerationTest(unittest.TestCase):
def setUp(self):
self.orgName = 'orgName'
self.rep... | true | true |
1c3b16d7582cd20af1931a5780603ab312df1df6 | 5,335 | py | Python | sinergym/utils/evaluation.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 23 | 2021-10-30T15:42:24.000Z | 2022-03-29T13:27:39.000Z | sinergym/utils/evaluation.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 93 | 2021-09-30T09:05:31.000Z | 2022-03-31T18:11:57.000Z | sinergym/utils/evaluation.py | jajimer/sinergym | 685bcb3cda8095eef1add2b5d12e0ce102efefe9 | [
"MIT"
] | 7 | 2021-11-24T10:28:42.000Z | 2022-03-04T14:11:29.000Z | """Custom policy evaluations for Evaluation Callbacks."""
from typing import Any, Callable, Dict, Optional, Union
import gym
import numpy as np
from stable_baselines3.common import base_class
from stable_baselines3.common.vec_env import VecEnv
def evaluate_policy(model: "base_class.BaseAlgorithm",
... | 50.809524 | 141 | 0.56926 |
from typing import Any, Callable, Dict, Optional, Union
import gym
import numpy as np
from stable_baselines3.common import base_class
from stable_baselines3.common.vec_env import VecEnv
def evaluate_policy(model: "base_class.BaseAlgorithm",
env: Union[gym.Env,
VecE... | true | true |
1c3b17069c9737cf2b01ab0b39710f8ac86971f0 | 1,091 | py | Python | src/agents/util/agent_credentials.py | MelleStarke/MAS_B06 | fbedc7459006c0915428f0122d923dd41b57b51e | [
"MIT"
] | null | null | null | src/agents/util/agent_credentials.py | MelleStarke/MAS_B06 | fbedc7459006c0915428f0122d923dd41b57b51e | [
"MIT"
] | null | null | null | src/agents/util/agent_credentials.py | MelleStarke/MAS_B06 | fbedc7459006c0915428f0122d923dd41b57b51e | [
"MIT"
] | null | null | null | sender = ("masb6-sender@01337.io", "sender-pass")
receiver = ("masb6-receiver@01337.io", "receiver-pass")
pra = ("masb6-pra@01337.io", "pra-pass")
kma = ("masb6-kma@01337.io", "kma-pass")
ca = ("masb6-ca@01337.io", "ca-pass")
oaa = ("masb6-oaa@01337.io", "oaa-pass")
ssa = ("masb6-ssa@01337.... | 40.407407 | 100 | 0.55912 | sender = ("masb6-sender@01337.io", "sender-pass")
receiver = ("masb6-receiver@01337.io", "receiver-pass")
pra = ("masb6-pra@01337.io", "pra-pass")
kma = ("masb6-kma@01337.io", "kma-pass")
ca = ("masb6-ca@01337.io", "ca-pass")
oaa = ("masb6-oaa@01337.io", "oaa-pass")
ssa = ("masb6-ssa@01337.... | true | true |
1c3b170fd3f62bce27b92d5cb1ef3d235cf983ae | 454 | py | Python | manage.py | sladebot/traffiko-data | 459d13185057666a2dbee22031e3ecc549ff5e37 | [
"MIT"
] | null | null | null | manage.py | sladebot/traffiko-data | 459d13185057666a2dbee22031e3ecc549ff5e37 | [
"MIT"
] | null | null | null | manage.py | sladebot/traffiko-data | 459d13185057666a2dbee22031e3ecc549ff5e37 | [
"MIT"
] | null | null | null | # This file starts the WSGI web application.
# - Heroku starts gunicorn, which loads Procfile, which starts manage.py
# - Developers can run it from the command line: python runserver.py
from main import manager, server
# Start a development web server, processing extra command line parameters. E.g.:
# - python manag... | 34.923077 | 81 | 0.751101 |
from main import manager, server
if __name__ == "__main__":
manager.add_command("runserver", server)
manager.run()
| true | true |
1c3b1735c55d3fa7f817015dbdaa357c535f0a45 | 5,087 | py | Python | 25_clock_signal.py | KanegaeGabriel/advent-of-code-2016 | 68a46604ebae7d96a196c1fcf2666f1e74ee2999 | [
"MIT"
] | null | null | null | 25_clock_signal.py | KanegaeGabriel/advent-of-code-2016 | 68a46604ebae7d96a196c1fcf2666f1e74ee2999 | [
"MIT"
] | null | null | null | 25_clock_signal.py | KanegaeGabriel/advent-of-code-2016 | 68a46604ebae7d96a196c1fcf2666f1e74ee2999 | [
"MIT"
] | null | null | null | ################################
# --- Day 25: Clock Signal --- #
################################
import AOCUtils
class VM:
def __init__(self, program):
self.program = program[:]
self.pc = 0
self.registers = {"a": 0, "b": 0, "c": 0, "d": 0}
self.lastOutput = 1
self.output... | 42.041322 | 103 | 0.244348 |
import AOCUtils
class VM:
def __init__(self, program):
self.program = program[:]
self.pc = 0
self.registers = {"a": 0, "b": 0, "c": 0, "d": 0}
self.lastOutput = 1
self.outputLength = 0
self.loops = False
def run(self):
while self.pc < len(self.program)... | true | true |
1c3b196bf441c75de9b48e2bfc9dfd8364686b6a | 2,579 | py | Python | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# 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 u... | 38.492537 | 100 | 0.705312 |
import os
import json
import time
import json_tricks
from ..common import init_logger, env_args
_sysdir = os.environ['NNI_SYS_DIR']
if not os.path.exists(os.path.join(_sysdir, '.nni')):
os.makedirs(os.path.join(_sysdir, '.nni'))
_metric_file = open(os.path.join(_sysdir, '.nni', 'metrics'), 'wb')
_outputdir = os... | true | true |
1c3b197d31e7c6ec15cd503dbc7f1b1a4607c696 | 1,711 | py | Python | profiles_api/models.py | rs2pydev/profiles-rest-api | e2fc7f0cf664586bf688b7e1b921eb5ae8bcfaf2 | [
"MIT"
] | null | null | null | profiles_api/models.py | rs2pydev/profiles-rest-api | e2fc7f0cf664586bf688b7e1b921eb5ae8bcfaf2 | [
"MIT"
] | null | null | null | profiles_api/models.py | rs2pydev/profiles-rest-api | e2fc7f0cf664586bf688b7e1b921eb5ae8bcfaf2 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def create_user(self, email... | 30.553571 | 67 | 0.649912 | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
def create_user(self, email, name, password=None):
if not ... | true | true |
1c3b19df73a5d7575da69233da553894bb996fb0 | 7,661 | py | Python | python_modules/dagster/dagster/core/launcher/default_run_launcher.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/launcher/default_run_launcher.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/launcher/default_run_launcher.py | coderanger/dagster | d3e323f8ed55cd906d6f44f19595348ea1580b2d | [
"Apache-2.0"
] | null | null | null | import time
import weakref
import grpc
from dagster import check, seven
from dagster.core.errors import DagsterLaunchFailedError
from dagster.core.host_representation import ExternalPipeline
from dagster.core.host_representation.handle import (
GrpcServerRepositoryLocationHandle,
ManagedGrpcPythonEnvRepository... | 34.822727 | 100 | 0.645869 | import time
import weakref
import grpc
from dagster import check, seven
from dagster.core.errors import DagsterLaunchFailedError
from dagster.core.host_representation import ExternalPipeline
from dagster.core.host_representation.handle import (
GrpcServerRepositoryLocationHandle,
ManagedGrpcPythonEnvRepository... | true | true |
1c3b1a4a1cf17399ad55f386d2b7743cb44d6bef | 4,561 | py | Python | DQN.py | indigoLovee/DQN | 21a30484014331b21047ecddac4fa584828ee80a | [
"MIT"
] | 1 | 2022-01-17T11:42:20.000Z | 2022-01-17T11:42:20.000Z | DQN.py | indigoLovee/DQN | 21a30484014331b21047ecddac4fa584828ee80a | [
"MIT"
] | null | null | null | DQN.py | indigoLovee/DQN | 21a30484014331b21047ecddac4fa584828ee80a | [
"MIT"
] | null | null | null | import torch as T
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from buffer import ReplayBuffer
device = T.device("cuda:0" if T.cuda.is_available() else "cpu")
class DeepQNetwork(nn.Module):
def __init__(self, alpha, state_dim, action_dim, fc1_dim, fc2_dim):... | 38.008333 | 107 | 0.657312 | import torch as T
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
from buffer import ReplayBuffer
device = T.device("cuda:0" if T.cuda.is_available() else "cpu")
class DeepQNetwork(nn.Module):
def __init__(self, alpha, state_dim, action_dim, fc1_dim, fc2_dim):... | true | true |
1c3b1a4b346c13ff2379002ebe655770265d47e4 | 581 | py | Python | galata/jupyter_server_test_config.py | xjc90s/jupyterlab | 82df0b635dae2c1a70a7c41fe7ee7af1c1caefb2 | [
"BSD-3-Clause"
] | null | null | null | galata/jupyter_server_test_config.py | xjc90s/jupyterlab | 82df0b635dae2c1a70a7c41fe7ee7af1c1caefb2 | [
"BSD-3-Clause"
] | 8 | 2022-01-04T19:19:07.000Z | 2022-03-03T22:11:12.000Z | galata/jupyter_server_test_config.py | xjc90s/jupyterlab | 82df0b635dae2c1a70a7c41fe7ee7af1c1caefb2 | [
"BSD-3-Clause"
] | null | null | null | import getpass
import os
from tempfile import mkdtemp
# Test if we are running in a docker
if getpass.getuser() == "jovyan":
c.ServerApp.ip = "0.0.0.0"
c.ServerApp.port = 8888
c.ServerApp.port_retries = 0
c.ServerApp.open_browser = False
c.LabApp.dev_mode = True
c.ServerApp.root_dir = os.environ.get("JUPYTERLAB_... | 26.409091 | 99 | 0.753873 | import getpass
import os
from tempfile import mkdtemp
if getpass.getuser() == "jovyan":
c.ServerApp.ip = "0.0.0.0"
c.ServerApp.port = 8888
c.ServerApp.port_retries = 0
c.ServerApp.open_browser = False
c.LabApp.dev_mode = True
c.ServerApp.root_dir = os.environ.get("JUPYTERLAB_GALATA_ROOT_DIR", mkdtemp(prefix="gal... | true | true |
1c3b1a94c848ca8a9589a7766f6c73f540f9bc4f | 20,270 | py | Python | examples/6a586378-063a-427c-92b2-87d6236615c6.py | lapaniku/GAS | e49ce302689af683da744cd172e0359c0ba0af86 | [
"MIT"
] | null | null | null | examples/6a586378-063a-427c-92b2-87d6236615c6.py | lapaniku/GAS | e49ce302689af683da744cd172e0359c0ba0af86 | [
"MIT"
] | null | null | null | examples/6a586378-063a-427c-92b2-87d6236615c6.py | lapaniku/GAS | e49ce302689af683da744cd172e0359c0ba0af86 | [
"MIT"
] | null | null | null | # This program was generated by "Generative Art Synthesizer"
# Generation date: 2021-11-28 02:06:28 UTC
# GAS change date: 2021-11-28 01:31:12 UTC
# GAS md5 hash: c291ffb9de6ad6dea37797c00163f591
# Python version: 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# For more informat... | 71.879433 | 676 | 0.694919 |
import os import numpy as np from PIL import Image
SIZE = 768
GRID_CHANNELS = 30
def test_values(arr):
if np.isnan(arr).any():
raise Exception('Array has None elements!')
if np.amin(arr) < -1 or np.amax(arr) > 1:
raise Exception('Values went to far! [ %.2f : %.2f ]'%(np.amin(arr),... | true | true |
1c3b1cd38bdc17c30ae3aa866f74ca00c594e86d | 863 | py | Python | exercises/en/test_03_12.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/test_03_12.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/test_03_12.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | def test():
assert (
len(nlp.pipeline) == 1 and nlp.pipe_names[0] == "countries_component"
), "Did you add the component correctly?"
assert Span.has_extension("capital"), "Did you set the extension on the span?"
ext = Span.get_extension("capital")
assert ext[2] is not None, "Did you register... | 43.15 | 83 | 0.653534 | def test():
assert (
len(nlp.pipeline) == 1 and nlp.pipe_names[0] == "countries_component"
), "Did you add the component correctly?"
assert Span.has_extension("capital"), "Did you set the extension on the span?"
ext = Span.get_extension("capital")
assert ext[2] is not None, "Did you register... | true | true |
1c3b1dca3d55ec0370a15a8cf85954b428319f53 | 2,231 | py | Python | projects/convai/convai_bot.py | markr-fu-berlin/ParlAI | 23f014c38ee502091fdd8623f5c8a6f2c3216e92 | [
"BSD-3-Clause"
] | 2 | 2020-03-22T10:18:09.000Z | 2020-05-06T21:48:47.000Z | projects/convai/convai_bot.py | urvishdesai/dialogue-encoding-tasks-parlai | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | null | null | null | projects/convai/convai_bot.py | urvishdesai/dialogue-encoding-tasks-parlai | 29743cc7b47c413c2181f68c0b7ef40a6f06a40f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-present, Moscow Institute of Physics and Technology.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS fi... | 27.8875 | 81 | 0.612281 |
from projects.convai.convai_world import ConvAIWorld
from parlai.core.params import ParlaiParser
from parlai.core.agents import Agent, create_agent
from parlai.core.utils import display_messages
import random
class ConvAISampleAgent(Agent):
def __init__(self, opt, shared=None):
super().__init__(opt, s... | true | true |
1c3b1e0c3cc5687f4dad6a7c5ee3273236a0217a | 707 | py | Python | plugin/src/py/android_screenshot_tests/no_op_device_name_calculator.py | AlexBeggs/screenshot-tests-for-android | 0e0212232e349d63e7f84d07c7680449b8a72120 | [
"Apache-2.0"
] | 1,747 | 2015-10-06T17:01:21.000Z | 2022-03-27T00:37:41.000Z | plugin/src/py/android_screenshot_tests/no_op_device_name_calculator.py | AlexBeggs/screenshot-tests-for-android | 0e0212232e349d63e7f84d07c7680449b8a72120 | [
"Apache-2.0"
] | 257 | 2015-10-06T19:41:43.000Z | 2022-03-25T09:40:48.000Z | plugin/src/py/android_screenshot_tests/no_op_device_name_calculator.py | AlexBeggs/screenshot-tests-for-android | 0e0212232e349d63e7f84d07c7680449b8a72120 | [
"Apache-2.0"
] | 258 | 2015-10-06T18:02:28.000Z | 2022-03-26T19:32:28.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... | 32.136364 | 74 | 0.732673 |
class NoOpDeviceNameCalculator:
def __init__(self):
pass
def name(self):
return ""
| true | true |
1c3b1e47587865d29b076ad3b6b78fd1a463bbd0 | 975 | py | Python | python/2/intersection.py | idimaster/playard | 647d813f5f0d21efd98cb7ba8b23fa3a00f58cd4 | [
"MIT"
] | null | null | null | python/2/intersection.py | idimaster/playard | 647d813f5f0d21efd98cb7ba8b23fa3a00f58cd4 | [
"MIT"
] | null | null | null | python/2/intersection.py | idimaster/playard | 647d813f5f0d21efd98cb7ba8b23fa3a00f58cd4 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data=None, next=None):
self.data = data
self.next = next
def check(lst1, lst2):
while lst1:
head = lst2
while head:
if head == lst1:
return True
head = head.next
lst1 = lst1.next
return False
d... | 18.75 | 45 | 0.541538 | class Node:
def __init__(self, data=None, next=None):
self.data = data
self.next = next
def check(lst1, lst2):
while lst1:
head = lst2
while head:
if head == lst1:
return True
head = head.next
lst1 = lst1.next
return False
d... | true | true |
1c3b1f65a17c4d8548367cba52b1989d07f1860e | 1,982 | py | Python | tests/integration/examples/test_config_secure_example.py | matilda-me/neo4j-python-driver | 4fb25a266841bf2a861f00d5dcf257bd5ae5c686 | [
"Apache-2.0"
] | null | null | null | tests/integration/examples/test_config_secure_example.py | matilda-me/neo4j-python-driver | 4fb25a266841bf2a861f00d5dcf257bd5ae5c686 | [
"Apache-2.0"
] | null | null | null | tests/integration/examples/test_config_secure_example.py | matilda-me/neo4j-python-driver | 4fb25a266841bf2a861f00d5dcf257bd5ae5c686 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) "Neo4j"
# Neo4j Sweden AB [http://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... | 31.967742 | 81 | 0.707366 |
import pytest
from neo4j._exceptions import BoltHandshakeError
from neo4j.exceptions import ServiceUnavailable
from tests.integration.examples import DriverSetupExample
import neo4j
from neo4j import GraphDatabase
class ConfigSecureExample(DriverSetupExample):
def __init__(self, uri, auth):
... | true | true |
1c3b1fd2feb6059341825a17cd39398395bdea6d | 864 | py | Python | python/509.fibonacci-number.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | 1 | 2019-04-11T12:34:55.000Z | 2019-04-11T12:34:55.000Z | python/509.fibonacci-number.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | python/509.fibonacci-number.py | fengbaoheng/leetcode | 2b6ec9adea383503acc23622ca5623161f7ca520 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=509 lang=python3
#
# [509] Fibonacci Number
#
# https://leetcode-cn.com/problems/fibonacci-number/description/
#
# algorithms
# Easy (65.10%)
# Total Accepted: 5.9K
# Total Submissions: 9K
# Testcase Example: '2'
#
# 斐波那契数,通常用 F(n) 表示,形成的序列称为斐波那契数列。该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和。也就是:
# ... | 13.292308 | 71 | 0.456019 | class Solution:
def fib(self, N: int) -> int:
f = [0,1]
for i in range(2, N+1):
f.append(f[i-1] + f[i-2])
return f[N]
| true | true |
1c3b200bebb7e070e6f4149dbd331eb1f225d018 | 3,156 | py | Python | Project/serve/predict.py | PankajPatil1/SageMaker-Deployment | be608dd09e82098fc87f2522a380472773dd9a37 | [
"MIT"
] | 1 | 2021-01-09T12:03:23.000Z | 2021-01-09T12:03:23.000Z | Project/serve/predict.py | PankajPatil1/SageMaker-Deployment | be608dd09e82098fc87f2522a380472773dd9a37 | [
"MIT"
] | null | null | null | Project/serve/predict.py | PankajPatil1/SageMaker-Deployment | be608dd09e82098fc87f2522a380472773dd9a37 | [
"MIT"
] | null | null | null | import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
from utils import review_to_words, convert_and_pad
def model_fn(mod... | 32.875 | 107 | 0.700253 | import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
from utils import review_to_words, convert_and_pad
def model_fn(mod... | true | true |
1c3b2017513b36ddd6ef8b39858c5b73e4170761 | 11,055 | py | Python | fedora_utilities/forms.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 2 | 2015-03-30T16:36:51.000Z | 2016-06-15T01:39:47.000Z | fedora_utilities/forms.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 2 | 2021-06-10T17:43:54.000Z | 2021-12-13T19:40:08.000Z | fedora_utilities/forms.py | jermnelson/aristotle-library-apps | f742847cd20c5b5c3b46dd53dfc395a2e1caa240 | [
"Apache-2.0"
] | 1 | 2015-11-08T00:40:11.000Z | 2015-11-08T00:40:11.000Z | __author__ = "Jeremy Nelson"
import datetime
from django import forms
from fedora_utilities.models import *
from eulfedora.server import Repository
from eulfedora.util import RequestFailed
repository = Repository()
DIGITAL_ORIGIN = [(1, 'born digital'),
(2, 'reformatted digital'),
... | 48.065217 | 119 | 0.44758 | __author__ = "Jeremy Nelson"
import datetime
from django import forms
from fedora_utilities.models import *
from eulfedora.server import Repository
from eulfedora.util import RequestFailed
repository = Repository()
DIGITAL_ORIGIN = [(1, 'born digital'),
(2, 'reformatted digital'),
... | true | true |
1c3b2035cec8ad04c7bf5c57c278d4962c099b4b | 2,597 | py | Python | device_loop.py | gve-sw/gve_devnet_webexclouddevices_reporting | c11e730b31cfff4ea8d6aa28aa1018802284945a | [
"RSA-MD"
] | null | null | null | device_loop.py | gve-sw/gve_devnet_webexclouddevices_reporting | c11e730b31cfff4ea8d6aa28aa1018802284945a | [
"RSA-MD"
] | null | null | null | device_loop.py | gve-sw/gve_devnet_webexclouddevices_reporting | c11e730b31cfff4ea8d6aa28aa1018802284945a | [
"RSA-MD"
] | null | null | null | '''
Copyright (c) 2020 Cisco and/or its affiliates.
This software is licensed to you under the terms of the Cisco Sample
Code License, Version 1.1 (the "License"). You may obtain a copy of the
License at
https://developer.cisco.com/docs/licenses
All use of the material herein must be in accordance wit... | 33.727273 | 78 | 0.67732 |
import requests
from credentials import token
place_device_list = []
place_device_name = []
personal_device_list = []
personal_device_name = []
url = "https://webexapis.com/v1/devices"
params = {"max": 100}
payload={}
headers = {'Authorization': f'Bearer {token}'}
response = requests.get(url, headers=headers, para... | true | true |
1c3b20476bf26b3e3eb7476884ad5716e216e0ac | 25,871 | py | Python | flexget/plugins/clients/rtorrent.py | davidcollom/Flexget | cd763e04afdf6da8f1673dd567a42d55d4cb3b6c | [
"MIT"
] | 1 | 2021-03-24T11:54:01.000Z | 2021-03-24T11:54:01.000Z | flexget/plugins/clients/rtorrent.py | davidcollom/Flexget | cd763e04afdf6da8f1673dd567a42d55d4cb3b6c | [
"MIT"
] | null | null | null | flexget/plugins/clients/rtorrent.py | davidcollom/Flexget | cd763e04afdf6da8f1673dd567a42d55d4cb3b6c | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from future.moves.xmlrpc import client as xmlrpc_client
from future.moves.urllib.parse import urlparse, urljoin
from future.utils import native_str
import logging
import os... | 35.931944 | 117 | 0.577983 | from __future__ import unicode_literals, division, absolute_import
from builtins import * from future.moves.xmlrpc import client as xmlrpc_client
from future.moves.urllib.parse import urlparse, urljoin
from future.utils import native_str
import logging
import os
import socket
import re
from time import sleep
from fl... | true | true |
1c3b207e2356cbcd1d34b8c086d0f5583457a91d | 7,011 | py | Python | pygcn/layers.py | NightmareNyx/pygcn | 3972f167ce7fcc41cb21284d75816dfd9a15f7ef | [
"MIT"
] | null | null | null | pygcn/layers.py | NightmareNyx/pygcn | 3972f167ce7fcc41cb21284d75816dfd9a15f7ef | [
"MIT"
] | null | null | null | pygcn/layers.py | NightmareNyx/pygcn | 3972f167ce7fcc41cb21284d75816dfd9a15f7ef | [
"MIT"
] | null | null | null | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class GraphConvolution(Module):
"""
Simple GCN layer, similar to https://arxiv.org/abs/1609.02907
"""
def __init__(sel... | 35.055 | 110 | 0.59535 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.modules.module import Module
from torch.nn.parameter import Parameter
class GraphConvolution(Module):
def __init__(self, in_features, out_features, bias=True, init_method='xavier'):
super(Grap... | true | true |
1c3b21a6051b643b15a54070521ba8535cdd779f | 963 | py | Python | serpent/templates/SerpentGamePlugin/files/serpent_game.py | DylanSpicker/SerpentAI | c48c4b072e0d1084a52eac569ad1c7fa02ac7348 | [
"MIT"
] | null | null | null | serpent/templates/SerpentGamePlugin/files/serpent_game.py | DylanSpicker/SerpentAI | c48c4b072e0d1084a52eac569ad1c7fa02ac7348 | [
"MIT"
] | null | null | null | serpent/templates/SerpentGamePlugin/files/serpent_game.py | DylanSpicker/SerpentAI | c48c4b072e0d1084a52eac569ad1c7fa02ac7348 | [
"MIT"
] | null | null | null | from serpent.game import Game
from .api.api import MyGameAPI
from serpent.utilities import Singleton
from serpent.game_launchers.web_browser_game_launcher import WebBrowser
import time
class SerpentGame(Game, metaclass=Singleton):
def __init__(self, **kwargs):
kwargs["platform"] = "PLATFORM"
... | 23.487805 | 71 | 0.624091 | from serpent.game import Game
from .api.api import MyGameAPI
from serpent.utilities import Singleton
from serpent.game_launchers.web_browser_game_launcher import WebBrowser
import time
class SerpentGame(Game, metaclass=Singleton):
def __init__(self, **kwargs):
kwargs["platform"] = "PLATFORM"
... | true | true |
1c3b234df1cdd611ccd280e733b2d1026d86edb6 | 4,266 | py | Python | openstack_dashboard/dashboards/sdscontroller/bandwidth_differentiation/slas/forms.py | iostackproject/SDS-dashboard | efa3d7968c738bfb10bc19776f24f2937d5802d8 | [
"Apache-2.0"
] | 1 | 2021-01-20T00:14:15.000Z | 2021-01-20T00:14:15.000Z | openstack_dashboard/dashboards/sdscontroller/bandwidth_differentiation/slas/forms.py | iostackproject/SDS-dashboard | efa3d7968c738bfb10bc19776f24f2937d5802d8 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/sdscontroller/bandwidth_differentiation/slas/forms.py | iostackproject/SDS-dashboard | efa3d7968c738bfb10bc19776f24f2937d5802d8 | [
"Apache-2.0"
] | null | null | null | from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard.api import sds_controller as api
from openstack_dashboard.dashboards.sdscontroller import common
from opens... | 47.4 | 136 | 0.568214 | from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import forms
from horizon import messages
from openstack_dashboard.api import sds_controller as api
from openstack_dashboard.dashboards.sdscontroller import common
from opens... | true | true |
1c3b24f48ef9c579975997fead4bf975d5a3a08e | 27,381 | py | Python | scipy/optimize/tests/test_optimize.py | dlax/scipy | 221cb8fa31c45d08ec6d9f946ebf9476bdc1fccd | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_optimize.py | dlax/scipy | 221cb8fa31c45d08ec6d9f946ebf9476bdc1fccd | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_optimize.py | dlax/scipy | 221cb8fa31c45d08ec6d9f946ebf9476bdc1fccd | [
"BSD-3-Clause"
] | null | null | null | """
Unit tests for optimization routines from optimize.py and tnc.py
Authors:
Ed Schofield, Nov 2005
Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py
"""
from numpy.testing import assert_raises, assert_allclose, \
assert_equal, assert_, TestCase, run_module_suite
... | 39.171674 | 84 | 0.491326 |
from numpy.testing import assert_raises, assert_allclose, \
assert_equal, assert_, TestCase, run_module_suite
from scipy import optimize
import numpy as np
from math import pow
class TestOptimize(TestCase):
def setUp(self):
self.F = np.array([[1,1,1],[1,1,0],[1,0,1],[1,0,0],[1,0,0]])
self... | true | true |
1c3b252e7303fe12913e9ea6bf8c6fcbbb64ce8d | 53,029 | py | Python | modest/substates/correlationvector.py | jtrunnels91/ModularEstimator | 1088f91440abd5a82d094311f51d0250ecca52e1 | [
"MIT"
] | null | null | null | modest/substates/correlationvector.py | jtrunnels91/ModularEstimator | 1088f91440abd5a82d094311f51d0250ecca52e1 | [
"MIT"
] | null | null | null | modest/substates/correlationvector.py | jtrunnels91/ModularEstimator | 1088f91440abd5a82d094311f51d0250ecca52e1 | [
"MIT"
] | null | null | null | ## @file CorrelationVector
# This package contains the #CorrelationVector class
import numpy as np
#from numpy import sin, cos, arcsin, arccos, arctan2, square, sqrt, abs, power
import matplotlib.pyplot as plt
from . import substate
from .. modularfilter import ModularFilter
from . oneDimensionalPositionVelocity impor... | 37.370684 | 268 | 0.561316 |
import numpy as np
import matplotlib.pyplot as plt
from . import substate
from .. modularfilter import ModularFilter
from . oneDimensionalPositionVelocity import oneDPositionVelocity
from .. signals.oneDimensionalObject import oneDObjectMeasurement
from .. utils import covarianceContainer
from scipy.linalg import bloc... | true | true |
1c3b2538f2746e7121c92de4686cb7c95ff849c8 | 221 | py | Python | shop_stripe/context_processors.py | execut/djangoshop-stripe | 09252e63cd92b92841b7fdb93517c6e6e4f29f23 | [
"MIT"
] | 11 | 2016-02-12T21:57:52.000Z | 2021-11-26T16:59:19.000Z | shop_stripe/context_processors.py | execut/djangoshop-stripe | 09252e63cd92b92841b7fdb93517c6e6e4f29f23 | [
"MIT"
] | 10 | 2016-05-27T09:14:57.000Z | 2020-08-29T18:37:51.000Z | shop_stripe/context_processors.py | execut/djangoshop-stripe | 09252e63cd92b92841b7fdb93517c6e6e4f29f23 | [
"MIT"
] | 6 | 2017-03-15T20:11:21.000Z | 2020-12-09T21:09:25.000Z | from django.conf import settings
def public_keys(request):
return {
'SHOP_STRIPE_PUBKEY': settings.SHOP_STRIPE['PUBKEY'],
'SHOP_STRIPE_PREFILL': getattr(settings, 'SHOP_STRIPE_PREFILL', False)
}
| 24.555556 | 78 | 0.705882 | from django.conf import settings
def public_keys(request):
return {
'SHOP_STRIPE_PUBKEY': settings.SHOP_STRIPE['PUBKEY'],
'SHOP_STRIPE_PREFILL': getattr(settings, 'SHOP_STRIPE_PREFILL', False)
}
| true | true |
1c3b275d469f25254cb1749dcc0fbb602fbe2454 | 2,488 | py | Python | src/folio_migration_tools/helper.py | chadmcinnis/folio_migration_tools | 39ee044a713a34c323324a956e3e8b54ee05c194 | [
"MIT"
] | null | null | null | src/folio_migration_tools/helper.py | chadmcinnis/folio_migration_tools | 39ee044a713a34c323324a956e3e8b54ee05c194 | [
"MIT"
] | null | null | null | src/folio_migration_tools/helper.py | chadmcinnis/folio_migration_tools | 39ee044a713a34c323324a956e3e8b54ee05c194 | [
"MIT"
] | null | null | null | import json
import logging
class Helper:
@staticmethod
def print_mapping_report(
report_file, total_records: int, mapped_folio_fields, mapped_legacy_fields
):
details_start = "<details><summary>Click to expand field report</summary> \n\n"
details_end = "</details> \n"
... | 41.466667 | 92 | 0.586415 | import json
import logging
class Helper:
@staticmethod
def print_mapping_report(
report_file, total_records: int, mapped_folio_fields, mapped_legacy_fields
):
details_start = "<details><summary>Click to expand field report</summary> \n\n"
details_end = "</details> \n"
... | true | true |
1c3b27937721cf673238b260e0824e37543372f2 | 606 | py | Python | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-HtmlTestRunner.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 6 | 2021-07-14T03:23:17.000Z | 2021-08-07T05:07:21.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-HtmlTestRunner.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-HtmlTestRunner.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 4 | 2021-07-13T19:44:06.000Z | 2021-08-13T07:49:35.000Z | # ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... | 33.666667 | 74 | 0.59571 |
from PyInstaller.utils.hooks import collect_data_files
datas = collect_data_files('HtmlTestRunner')
| true | true |
1c3b2877d359139a9c4bd39cb9d2c6770ac9a292 | 3,123 | py | Python | qiskit_nature/drivers/base_driver.py | SooluThomas/qiskit-nature | 0d509525b68b76d0f2d613d0e7409b9ea65cfcc0 | [
"Apache-2.0"
] | 1 | 2021-06-20T15:31:01.000Z | 2021-06-20T15:31:01.000Z | qiskit_nature/drivers/base_driver.py | SooluThomas/qiskit-nature | 0d509525b68b76d0f2d613d0e7409b9ea65cfcc0 | [
"Apache-2.0"
] | 1 | 2021-11-11T06:33:41.000Z | 2021-11-11T06:33:41.000Z | qiskit_nature/drivers/base_driver.py | SooluThomas/qiskit-nature | 0d509525b68b76d0f2d613d0e7409b9ea65cfcc0 | [
"Apache-2.0"
] | 3 | 2021-07-02T06:57:58.000Z | 2021-07-06T12:32:38.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 28.390909 | 85 | 0.632085 |
from typing import Optional
from abc import ABC, abstractmethod
from .molecule import Molecule
from ..exceptions import QiskitNatureError
from ..deprecation import DeprecatedType, warn_deprecated_same_type_name
class BaseDriver(ABC):
@abstractmethod
def __init__(
self,
molecule: Optional[M... | true | true |
1c3b293e5e02c883134daa1be35695079105d5dc | 1,479 | py | Python | the-lego-collector-s-dilemma-(linear-regression)/code.py | rsaurabh799/ga-learner-dsmp-repo | 024f054e0385fd5faa24804004e25d9f849363aa | [
"MIT"
] | null | null | null | the-lego-collector-s-dilemma-(linear-regression)/code.py | rsaurabh799/ga-learner-dsmp-repo | 024f054e0385fd5faa24804004e25d9f849363aa | [
"MIT"
] | null | null | null | the-lego-collector-s-dilemma-(linear-regression)/code.py | rsaurabh799/ga-learner-dsmp-repo | 024f054e0385fd5faa24804004e25d9f849363aa | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
# code starts here
df = pd.read_csv(path)
print(df.head(5))
X = df.drop('list_price',axis=1)
y = df['list_price']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.3,random_state = 6)
# code... | 19.72 | 147 | 0.684246 | import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
df = pd.read_csv(path)
print(df.head(5))
X = df.drop('list_price',axis=1)
y = df['list_price']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size = 0.3,random_state = 6)
import matplotlib.pyplot as plt
cols =... | true | true |
1c3b2949d9ded9a69579d2d96b2ece4af1dc088f | 3,144 | py | Python | Solver/attenuation.py | steveknipmeyer/ModelRelief | a3d067e0ed39a3a8ca78896c21eaa3e7293b15a2 | [
"MIT"
] | null | null | null | Solver/attenuation.py | steveknipmeyer/ModelRelief | a3d067e0ed39a3a8ca78896c21eaa3e7293b15a2 | [
"MIT"
] | null | null | null | Solver/attenuation.py | steveknipmeyer/ModelRelief | a3d067e0ed39a3a8ca78896c21eaa3e7293b15a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
.. module:: Attenutation
:synopsis: Support for attenuation of image components.
.. moduleauthor:: Steve Knipmeyer <steve@modelrelief.org>
"""
import numpy as np
from mathtools import MathTools
from logger import Logger
from services import Services
from tools import Colors
class Attenuat... | 33.094737 | 111 | 0.604008 | import numpy as np
from mathtools import MathTools
from logger import Logger
from services import Services
from tools import Colors
class AttenuationParameters:
def __init__(self, enabled: bool, factor: float, decay: float) -> None:
self.enabled: bool = enabled
self.factor: float = factor
... | true | true |
1c3b29ba50eb8e9e4d4eebbaa51ccf0760786e20 | 1,101 | py | Python | util/config/validators/test/test_validate_timemachine.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 1 | 2021-05-30T01:54:21.000Z | 2021-05-30T01:54:21.000Z | util/config/validators/test/test_validate_timemachine.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 20 | 2019-12-26T17:32:34.000Z | 2022-03-21T22:18:06.000Z | util/config/validators/test/test_validate_timemachine.py | anwarchk/quay | 23c5120790c619174e7d36784ca5aab7f4eece5c | [
"Apache-2.0"
] | 1 | 2020-05-31T16:28:40.000Z | 2020-05-31T16:28:40.000Z | import pytest
from util.config.validator import ValidatorContext
from util.config.validators import ConfigValidationException
from util.config.validators.validate_timemachine import TimeMachineValidator
@pytest.mark.parametrize('unvalidated_config', [
({}),
])
def test_validate_noop(unvalidated_config):
TimeMachi... | 33.363636 | 76 | 0.768392 | import pytest
from util.config.validator import ValidatorContext
from util.config.validators import ConfigValidationException
from util.config.validators.validate_timemachine import TimeMachineValidator
@pytest.mark.parametrize('unvalidated_config', [
({}),
])
def test_validate_noop(unvalidated_config):
TimeMachi... | true | true |
1c3b2b67143c8d3c3bc076c3bd8118dfd8c9e3d7 | 5,649 | py | Python | bloomstack_core/hook_events/delivery_note.py | harshmule-git/bloomstack_core | a22fc1e6dc006e909c79914acc82f3827f1769ee | [
"MIT"
] | 4 | 2021-03-01T08:44:39.000Z | 2021-12-21T18:02:14.000Z | bloomstack_core/hook_events/delivery_note.py | harshmule-git/bloomstack_core | a22fc1e6dc006e909c79914acc82f3827f1769ee | [
"MIT"
] | 23 | 2020-10-12T10:46:35.000Z | 2021-11-02T08:23:01.000Z | bloomstack_core/hook_events/delivery_note.py | harshmule-git/bloomstack_core | a22fc1e6dc006e909c79914acc82f3827f1769ee | [
"MIT"
] | 33 | 2020-10-09T13:24:10.000Z | 2022-02-01T20:59:03.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Bloom Stack and contributors
# For license information, please see license.txt
import frappe
from frappe import _
from frappe.utils import cstr, get_host_name
from bloomstack_core.bloomtrace import get_bloomtrace_client, make_integration_request
def create_integration_req... | 35.980892 | 138 | 0.761197 |
import frappe
from frappe import _
from frappe.utils import cstr, get_host_name
from bloomstack_core.bloomtrace import get_bloomtrace_client, make_integration_request
def create_integration_request(doc, method):
make_integration_request(doc.doctype, doc.name, "Package")
make_integration_request(doc.doctype, doc.nam... | true | true |
1c3b2bd14abfd96bf72a56c8aadcab303109db52 | 95 | py | Python | nn_script/test_config.py | Lotuslisa/semantic_segmentation | b53932bac95371af4631b04e16e2c5d182ae78ae | [
"Apache-2.0"
] | null | null | null | nn_script/test_config.py | Lotuslisa/semantic_segmentation | b53932bac95371af4631b04e16e2c5d182ae78ae | [
"Apache-2.0"
] | null | null | null | nn_script/test_config.py | Lotuslisa/semantic_segmentation | b53932bac95371af4631b04e16e2c5d182ae78ae | [
"Apache-2.0"
] | null | null | null | #from config import params
import config
#print(config.params)
print(config.p_img_h)
print(a)
| 13.571429 | 26 | 0.789474 | import config
print(config.p_img_h)
print(a)
| true | true |
1c3b2c2bee6770ec4ad925047cf3827cb50649b1 | 10,701 | py | Python | digits/task.py | Itsuro/DIGITS | 7754c7de7085ebbae16875b3d5a16c42b6e24a7b | [
"BSD-3-Clause"
] | 1 | 2021-07-22T04:35:09.000Z | 2021-07-22T04:35:09.000Z | digits/task.py | Itsuro/DIGITS | 7754c7de7085ebbae16875b3d5a16c42b6e24a7b | [
"BSD-3-Clause"
] | null | null | null | digits/task.py | Itsuro/DIGITS | 7754c7de7085ebbae16875b3d5a16c42b6e24a7b | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
from __future__ import absolute_import
import logging
import os.path
import platform
import re
import signal
import subprocess
import time
import flask
import gevent.event
from . import utils
from .config import config_value
from .status import Sta... | 31.017391 | 107 | 0.530698 | from __future__ import absolute_import
import logging
import os.path
import platform
import re
import signal
import subprocess
import time
import flask
import gevent.event
from . import utils
from .config import config_value
from .status import Status, StatusCls
import digits.log
PICKLE_VERSION = 1
class Task(Stat... | true | true |
1c3b2cc148e2f79f5a4ed7484eacb3e5b47fe720 | 5,676 | py | Python | sarveillance/utils.py | ropg/SARveillance | 94c0b348df4fc5b9ee532aadfe3514e105441a74 | [
"MIT"
] | null | null | null | sarveillance/utils.py | ropg/SARveillance | 94c0b348df4fc5b9ee532aadfe3514e105441a74 | [
"MIT"
] | null | null | null | sarveillance/utils.py | ropg/SARveillance | 94c0b348df4fc5b9ee532aadfe3514e105441a74 | [
"MIT"
] | null | null | null | import os
import subprocess
import ee
from geemap import png_to_gif
import matplotlib.pyplot as plt
from geemap.cartoee import get_map, add_gridlines, add_scale_bar_lite, add_north_arrow
def new_get_image_collection_gif(
ee_ic,
out_dir,
out_gif,
vis_params,
region,
cmap=None,
proj=None,
... | 34.4 | 223 | 0.619626 | import os
import subprocess
import ee
from geemap import png_to_gif
import matplotlib.pyplot as plt
from geemap.cartoee import get_map, add_gridlines, add_scale_bar_lite, add_north_arrow
def new_get_image_collection_gif(
ee_ic,
out_dir,
out_gif,
vis_params,
region,
cmap=None,
proj=None,
... | true | true |
1c3b2f7f03ede1591da94a2a82eba4306f1b4a39 | 1,252 | py | Python | src/ccc/multiset.py | ajcr/ccc | ba660ebd358a48ab3df7533b261f9597cede27be | [
"MIT"
] | 3 | 2019-10-07T09:38:15.000Z | 2020-01-20T16:36:26.000Z | src/ccc/multiset.py | ajcr/combination-calculator | 71108eef73bd2ea4367abe423251c7b6f21ba221 | [
"MIT"
] | 12 | 2019-02-10T22:01:48.000Z | 2020-06-06T21:31:51.000Z | src/ccc/multiset.py | ajcr/combination-calculator | 71108eef73bd2ea4367abe423251c7b6f21ba221 | [
"MIT"
] | null | null | null | from typing import AbstractSet, Dict, List, Optional, Tuple
from sympy import Poly, prod
from sympy.abc import x
from ccc.polynomialtracker import PolynomialTracker
class Multiset(PolynomialTracker):
"""
Track multisets that meet zero or more constraints.
"""
def __init__(
self,
si... | 27.822222 | 89 | 0.653355 | from typing import AbstractSet, Dict, List, Optional, Tuple
from sympy import Poly, prod
from sympy.abc import x
from ccc.polynomialtracker import PolynomialTracker
class Multiset(PolynomialTracker):
def __init__(
self,
size: int,
collection: Optional[Dict[str, int]] = None,
con... | true | true |
1c3b301f1807dcfd044bd7569726ac637e4756fe | 4,353 | py | Python | contrib/seeds/generate-seeds.py | Palem1988/ion_old | 2c2b532abf61e2a06231c1d3b4d9b2bd0cdb469a | [
"MIT"
] | 2 | 2017-01-16T13:42:19.000Z | 2017-01-16T17:14:59.000Z | contrib/seeds/generate-seeds.py | ionomy/ion_new | 759071e12ba2ab889221bf91d99bb052a3b98303 | [
"MIT"
] | 18 | 2017-01-19T09:19:48.000Z | 2017-01-27T01:59:30.000Z | contrib/seeds/generate-seeds.py | ionomy/ion_new | 759071e12ba2ab889221bf91d99bb052a3b98303 | [
"MIT"
] | 10 | 2017-01-17T19:54:55.000Z | 2017-02-11T19:26:43.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Copyright (c) 2017 CEVAP
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expect... | 31.092857 | 98 | 0.578911 |
from base64 import b32decode
from binascii import a2b_hex
import sys, os
import re
pchIPv4 = bytearray([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff])
pchOnionCat = bytearray([0xFD,0x87,0xD8,0x7E,0xEB,0x43])
def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:-6], T... | true | true |
1c3b318f2d6cd2c7a20239ca26ab5d61d0829056 | 327 | py | Python | aidants_connect_web/management/commands/notify_new_habilitation_requests.py | betagouv/Aidants_Connect | 2329d41545912460c4a43b5b41c892189fc1df11 | [
"MIT"
] | 16 | 2019-05-13T08:32:40.000Z | 2022-03-22T13:40:57.000Z | aidants_connect_web/management/commands/notify_new_habilitation_requests.py | betagouv/Aidants_Connect | 2329d41545912460c4a43b5b41c892189fc1df11 | [
"MIT"
] | 207 | 2019-05-15T16:30:52.000Z | 2022-03-31T15:26:25.000Z | aidants_connect_web/management/commands/notify_new_habilitation_requests.py | betagouv/Aidants_Connect | 2329d41545912460c4a43b5b41c892189fc1df11 | [
"MIT"
] | 12 | 2019-11-08T13:44:35.000Z | 2022-02-14T15:38:37.000Z | from django.core.management.base import BaseCommand
from aidants_connect_web.tasks import notify_new_habilitation_requests
class Command(BaseCommand):
help = "Notifies staff administrators that new habilitation requests are to be seen"
def handle(self, *args, **options):
notify_new_habilitation_requ... | 29.727273 | 88 | 0.792049 | from django.core.management.base import BaseCommand
from aidants_connect_web.tasks import notify_new_habilitation_requests
class Command(BaseCommand):
help = "Notifies staff administrators that new habilitation requests are to be seen"
def handle(self, *args, **options):
notify_new_habilitation_requ... | true | true |
1c3b325bf949db86cc6337fac1baaa24425c6b1b | 10,920 | py | Python | tods/detection_algorithm/PyodIsolationForest.py | KODeKarnage/tods | d1b5395d0d530630dc514638726face4d4796d01 | [
"Apache-2.0"
] | 1 | 2020-11-29T05:50:02.000Z | 2020-11-29T05:50:02.000Z | tods/detection_algorithm/PyodIsolationForest.py | MaxMohammadi/tods | 40e79269f14b60e090028188f1ed8380d518270f | [
"Apache-2.0"
] | null | null | null | tods/detection_algorithm/PyodIsolationForest.py | MaxMohammadi/tods | 40e79269f14b60e090028188f1ed8380d518270f | [
"Apache-2.0"
] | 1 | 2021-03-26T03:03:28.000Z | 2021-03-26T03:03:28.000Z | from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple
from numpy import ndarray
from collections import OrderedDict
from scipy import sparse
import os
import sklearn
import numpy
import typing
# Custom import commands if any
import warnings
import numpy as np
from sklearn.utils import check_ar... | 39.422383 | 174 | 0.67381 | from typing import Any, Callable, List, Dict, Union, Optional, Sequence, Tuple
from numpy import ndarray
from collections import OrderedDict
from scipy import sparse
import os
import sklearn
import numpy
import typing
import warnings
import numpy as np
from sklearn.utils import check_array
from sklearn.exceptions impo... | true | true |
1c3b32ae49039d2114ead736aae2b810829bd738 | 13,305 | py | Python | testing/test_tmpdir.py | zhangq0813/pytest | 2d9dac95ecbc67c73fc9f834a9a551d93befe159 | [
"MIT"
] | 2 | 2016-06-27T06:44:26.000Z | 2021-08-29T03:03:48.000Z | testing/test_tmpdir.py | zhangq0813/pytest | 2d9dac95ecbc67c73fc9f834a9a551d93befe159 | [
"MIT"
] | null | null | null | testing/test_tmpdir.py | zhangq0813/pytest | 2d9dac95ecbc67c73fc9f834a9a551d93befe159 | [
"MIT"
] | 1 | 2015-12-08T03:13:28.000Z | 2015-12-08T03:13:28.000Z | import os
import stat
import sys
import attr
import pytest
from _pytest import pathlib
from _pytest.pathlib import Path
def test_tmpdir_fixture(testdir):
p = testdir.copy_example("tmpdir/tmpdir_fixture.py")
results = testdir.runpytest(p)
results.stdout.fnmatch_lines(["*1 passed*"])
@attr.s
class FakeC... | 28.798701 | 87 | 0.634573 | import os
import stat
import sys
import attr
import pytest
from _pytest import pathlib
from _pytest.pathlib import Path
def test_tmpdir_fixture(testdir):
p = testdir.copy_example("tmpdir/tmpdir_fixture.py")
results = testdir.runpytest(p)
results.stdout.fnmatch_lines(["*1 passed*"])
@attr.s
class FakeC... | true | true |
1c3b32ec0caeaa5fc611f6e4bfcc1c3e2e4a6792 | 1,402 | py | Python | ceres/cmds/stop.py | duderino999/ceres-combineharvester | f63ab6c4d0e33c3b6550c1f5641f28ab2c68b001 | [
"Apache-2.0"
] | 39 | 2021-08-04T14:49:27.000Z | 2022-03-29T16:30:19.000Z | ceres/cmds/stop.py | rickguo216/ceres-combineharvester | e93b26a77b1fc4fe9de80d10f745b09a13f9c288 | [
"Apache-2.0"
] | 30 | 2021-08-19T22:44:31.000Z | 2022-03-29T19:09:26.000Z | ceres/cmds/stop.py | rickguo216/ceres-combineharvester | e93b26a77b1fc4fe9de80d10f745b09a13f9c288 | [
"Apache-2.0"
] | 23 | 2021-08-07T07:33:20.000Z | 2022-03-27T11:15:00.000Z | import sys
from pathlib import Path
import click
from ceres.util.service_groups import all_groups, services_for_groups
async def async_stop(root_path: Path, group: str, stop_daemon: bool) -> int:
from ceres.daemon.client import connect_to_daemon_and_validate
daemon = await connect_to_daemon_and_validate(ro... | 29.829787 | 106 | 0.675464 | import sys
from pathlib import Path
import click
from ceres.util.service_groups import all_groups, services_for_groups
async def async_stop(root_path: Path, group: str, stop_daemon: bool) -> int:
from ceres.daemon.client import connect_to_daemon_and_validate
daemon = await connect_to_daemon_and_validate(ro... | true | true |
1c3b32f7451e1d9f5b69fab805e7fcfefbf65a3d | 7,541 | py | Python | blog/settings.py | JeffreyDrJ/myfirstblog | 5b1f0fbd6c85027bad7d0e24d67251f41da53fac | [
"MIT"
] | null | null | null | blog/settings.py | JeffreyDrJ/myfirstblog | 5b1f0fbd6c85027bad7d0e24d67251f41da53fac | [
"MIT"
] | 1 | 2021-05-29T17:09:43.000Z | 2021-05-29T17:09:43.000Z | blog/settings.py | JeffreyDrJ/myfirstblog | 5b1f0fbd6c85027bad7d0e24d67251f41da53fac | [
"MIT"
] | null | null | null | """
Django settings for blog project.
Generated by 'django-admin startproject' using Django 3.2.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib impo... | 30.407258 | 97 | 0.610396 |
from pathlib import Path
import os
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-r+%^+a^s#d$gyexts9osfo)yb=4@w(+$=(8iv5r59i@q14(f+x'
DEBUG = True
#TODO:内网访问10.88.137.43
ALLOWED_HOSTS = []
# Application definition,迁移前必须做
INSTALLED_APPS = [
'django.contrib.admin',
'django.... | true | true |
1c3b33f1b0f1ea6d04fb531fb279f87b672794cc | 232 | py | Python | ex007.py | cristianoandrad/ExerciciosPythonCursoEmVideo | 362603436b71c8ef8386d7a9ab3c5fed0b8d63f7 | [
"MIT"
] | null | null | null | ex007.py | cristianoandrad/ExerciciosPythonCursoEmVideo | 362603436b71c8ef8386d7a9ab3c5fed0b8d63f7 | [
"MIT"
] | null | null | null | ex007.py | cristianoandrad/ExerciciosPythonCursoEmVideo | 362603436b71c8ef8386d7a9ab3c5fed0b8d63f7 | [
"MIT"
] | null | null | null | # Desenvolva um programa que leia as duas notas de um aluno, calcule e mostre a sua média.
n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
print('A media do aluno é {}'.format((n1+n2)/2))
| 38.666667 | 90 | 0.693966 |
n1 = float(input('Digite a primeira nota: '))
n2 = float(input('Digite a segunda nota: '))
print('A media do aluno é {}'.format((n1+n2)/2))
| true | true |
1c3b347aadee4591b9849140440593325cb8225f | 4,563 | py | Python | digsby/src/util/json.py | ifwe/digsby | f5fe00244744aa131e07f09348d10563f3d8fa99 | [
"Python-2.0"
] | 35 | 2015-08-15T14:32:38.000Z | 2021-12-09T16:21:26.000Z | digsby/src/util/json.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 4 | 2015-09-12T10:42:57.000Z | 2017-02-27T04:05:51.000Z | digsby/src/util/json.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 15 | 2015-07-10T23:58:07.000Z | 2022-01-23T22:16:33.000Z | import simplejson
# +---------------+-------------------+
# | JSON | Python |
# +===============+===================+
# | object | dict |
# +---------------+-------------------+
# | array | list |
# +---------------+-------------... | 36.798387 | 90 | 0.42735 | import simplejson
def serialize(thing):
if type(thing) is dict:
return dict((serialize(a), serialize(b)) for a,b in thing.iteritems())
elif isinstance(thing, str):
return '__str__' + thing
elif isinstance(thing, unicode):
return '__unicode__' + thing
elif isinstance(t... | true | true |
1c3b34d1e89985ed582278274611ebbe4199d7dc | 533 | py | Python | Lesson2/pandas_and_json.py | rmhyman/DataScience | c839c97c76f104ab298563a5c8b48f6d90be5f60 | [
"MIT"
] | 1 | 2015-09-17T18:49:09.000Z | 2015-09-17T18:49:09.000Z | Lesson2/pandas_and_json.py | rmhyman/DataScience | c839c97c76f104ab298563a5c8b48f6d90be5f60 | [
"MIT"
] | null | null | null | Lesson2/pandas_and_json.py | rmhyman/DataScience | c839c97c76f104ab298563a5c8b48f6d90be5f60 | [
"MIT"
] | null | null | null | import json
import requests
import pprint
def api_get_request(url):
# In this exercise, you want to call the last.fm API to get a list of the
# top artists in Spain.
#
# Once you've done this, return the name of the number 1 top artist in Spain.
data = requests.get(url).text
df = json... | 35.533333 | 92 | 0.645403 | import json
import requests
import pprint
def api_get_request(url):
data = requests.get(url).text
df = json.loads(data)
pp = pprint.PrettyPrinter(indent=4)
#pp.pprint(df['topartists']['artist']['rank' == 1]['name'])
return df['topartists']['artist']['rank' == 1]['name'] # r... | true | true |
1c3b35595be26ce133518cd58d3d352daa473df5 | 804 | py | Python | setup.py | t3m8ch/clepsydra | 5c755a91713ae70432627aec381f567aeed92f56 | [
"Apache-2.0"
] | 14 | 2021-11-10T03:07:13.000Z | 2022-02-17T07:13:51.000Z | setup.py | t3m8ch/clepsydra | 5c755a91713ae70432627aec381f567aeed92f56 | [
"Apache-2.0"
] | 12 | 2021-11-09T20:05:30.000Z | 2022-01-09T08:58:48.000Z | setup.py | t3m8ch/clepsydra | 5c755a91713ae70432627aec381f567aeed92f56 | [
"Apache-2.0"
] | 1 | 2022-02-18T07:33:53.000Z | 2022-02-18T07:33:53.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os import path
from setuptools import setup, find_packages
this_directory = path.abspath(path.dirname(__file__))
setup(
name='clepsydra',
description='Liquid scheduler for python',
version='0.1a1',
url='https://github.com/tishka17/clepsydra',
... | 24.363636 | 65 | 0.634328 | from os import path
from setuptools import setup, find_packages
this_directory = path.abspath(path.dirname(__file__))
setup(
name='clepsydra',
description='Liquid scheduler for python',
version='0.1a1',
url='https://github.com/tishka17/clepsydra',
author='A. Tikhonov',
author_email='17@iti... | true | true |
1c3b36913d4c6e836eb061c53306b6be514f88e4 | 3,090 | py | Python | alipay/aop/api/domain/KbAdvertAdvSingleVoucherResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/KbAdvertAdvSingleVoucherResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/KbAdvertAdvSingleVoucherResponse.py | snowxmas/alipay-sdk-python-all | 96870ced60facd96c5bce18d19371720cbda3317 | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KbAdvertAdvContentResponse import KbAdvertAdvContentResponse
from alipay.aop.api.domain.KbAdvertAdvContent import KbAdvertAdvContent
from alipay.aop.api.domain.KbAdvertSubjectVouche... | 33.956044 | 97 | 0.621359 | import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.KbAdvertAdvContentResponse import KbAdvertAdvContentResponse
from alipay.aop.api.domain.KbAdvertAdvContent import KbAdvertAdvContent
from alipay.aop.api.domain.KbAdvertSubjectVoucherResponse import KbAdvertSubjectVoucherRespons... | true | true |
1c3b379f9d617573f18aed9d0cc8086eb81f5c44 | 11,849 | py | Python | src/m5_more_sequences.py | manchekl/12-MoreSequences | 2bc19eaee820e13594b95fc105124c96dbe91b63 | [
"MIT"
] | null | null | null | src/m5_more_sequences.py | manchekl/12-MoreSequences | 2bc19eaee820e13594b95fc105124c96dbe91b63 | [
"MIT"
] | null | null | null | src/m5_more_sequences.py | manchekl/12-MoreSequences | 2bc19eaee820e13594b95fc105124c96dbe91b63 | [
"MIT"
] | null | null | null | """
This module lets you practice various patterns
for ITERATING through SEQUENCES, including:
-- Beginning to end
-- Other ranges (e.g., backwards and every-3rd-item)
-- The COUNT/SUM/etc pattern
-- The FIND pattern (via LINEAR SEARCH)
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
... | 35.797583 | 79 | 0.520213 |
import rosegraphics as rg
def main():
run_test_sum_radii()
run_test_count_last_n_odds()
run_test_index_of_first_negative()
run_test_contains_an_a()
def run_test_sum_radii():
print()
print('--------------------------------------------------')
print('Testing the sum_radii function:')
... | true | true |
1c3b38e84c3406747fd2a13b8335964a1d70b3b2 | 878 | py | Python | setup.py | msantino/publish-event-sns | 49e64d73f84a5120833abadd5532bbaca85a4bfb | [
"MIT"
] | null | null | null | setup.py | msantino/publish-event-sns | 49e64d73f84a5120833abadd5532bbaca85a4bfb | [
"MIT"
] | null | null | null | setup.py | msantino/publish-event-sns | 49e64d73f84a5120833abadd5532bbaca85a4bfb | [
"MIT"
] | null | null | null | import io
from os import path
from setuptools import setup, find_packages
MYDIR = path.abspath(path.dirname(__file__))
cmdclass = {}
ext_modules = []
setup(
name='publish_event_sns',
version='0.0.3',
author="Marcelo Santino",
author_email="eu@marcelosantino.com.br",
description="Publish message... | 29.266667 | 72 | 0.682232 | import io
from os import path
from setuptools import setup, find_packages
MYDIR = path.abspath(path.dirname(__file__))
cmdclass = {}
ext_modules = []
setup(
name='publish_event_sns',
version='0.0.3',
author="Marcelo Santino",
author_email="eu@marcelosantino.com.br",
description="Publish message... | true | true |
1c3b39831ee64c095ad2623ef02eba501cfee32b | 3,146 | py | Python | datasets/qm9.py | xptree/nmp_qc | 45d94a885753c670db1455e015cede410e1720a5 | [
"MIT"
] | null | null | null | datasets/qm9.py | xptree/nmp_qc | 45d94a885753c670db1455e015cede410e1720a5 | [
"MIT"
] | null | null | null | datasets/qm9.py | xptree/nmp_qc | 45d94a885753c670db1455e015cede410e1720a5 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
qm9.py:
Usage:
"""
# Networkx should be imported before torch
import networkx as nx
import torch.utils.data as data
import numpy as np
import argparse
import datasets.utils as utils
import time
import os,sys
import torch
reader_folder = os.path.realpath( os.path.absp... | 28.862385 | 149 | 0.665607 |
import networkx as nx
import torch.utils.data as data
import numpy as np
import argparse
import datasets.utils as utils
import time
import os,sys
import torch
reader_folder = os.path.realpath( os.path.abspath('../GraphReader'))
if reader_folder not in sys.path:
sys.path.insert(1, reader_folder)
from GraphRead... | true | true |
1c3b39a0fcda1374ba1e8bc526c006af509aca72 | 2,411 | py | Python | utils.py | atul04/Grammar-Correction | 89ee3338f901735cbad2144e5e41a54ee11213f9 | [
"MIT"
] | null | null | null | utils.py | atul04/Grammar-Correction | 89ee3338f901735cbad2144e5e41a54ee11213f9 | [
"MIT"
] | null | null | null | utils.py | atul04/Grammar-Correction | 89ee3338f901735cbad2144e5e41a54ee11213f9 | [
"MIT"
] | null | null | null | import torch
import spacy
from torchtext.data.metrics import bleu_score
import sys
def translate_sentence(model, sentence, german, english, device, max_length=50):
# Load german tokenizer
spacy_ger = spacy.load("en")
# Create tokens using spacy and everything in lower case (which is what our vocab is)
... | 30.518987 | 89 | 0.669432 | import torch
import spacy
from torchtext.data.metrics import bleu_score
import sys
def translate_sentence(model, sentence, german, english, device, max_length=50):
spacy_ger = spacy.load("en")
if type(sentence) == str:
tokens = [token.text.lower() for token in spacy_ger(sentence)]
else:
... | true | true |
1c3b3b3590471ebbc7d8519cc5359bc0b07f4db5 | 12,468 | py | Python | cloudcafe/compute/hypervisors/xenserver/models/virtual_machine.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/compute/hypervisors/xenserver/models/virtual_machine.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | null | null | null | cloudcafe/compute/hypervisors/xenserver/models/virtual_machine.py | rcbops-qa/cloudcafe | d937f85496aadafbb94a330b9adb8ea18bee79ba | [
"Apache-2.0"
] | 1 | 2020-04-13T17:44:28.000Z | 2020-04-13T17:44:28.000Z | """
Copyright 2013 Rackspace
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
dist... | 48.513619 | 78 | 0.671399 |
from cafe.engine.models.base import BaseModel
class VirtualMachine(BaseModel):
def __init__(self, label=None, description=None, vcpus_at_startup=None,
power_state=None, vcpus_params=None, vcpus_max=None,
xenstore_data=None, memory_static_min=None,
memory_static... | true | true |
1c3b3b814414fec7149bdda04bee0237ffec2988 | 952 | py | Python | src/testing/TestON/drivers/common/api/controllerdriver.py | securedataplane/preacher | 2f76581de47036e79cd6e1183948c88b35ce4950 | [
"MIT"
] | 1 | 2020-07-23T08:06:44.000Z | 2020-07-23T08:06:44.000Z | src/testing/TestON/drivers/common/api/controllerdriver.py | securedataplane/preacher | 2f76581de47036e79cd6e1183948c88b35ce4950 | [
"MIT"
] | null | null | null | src/testing/TestON/drivers/common/api/controllerdriver.py | securedataplane/preacher | 2f76581de47036e79cd6e1183948c88b35ce4950 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Created on 29-Nov-2012
author:: Anil Kumar ( anilkumar.s@paxterrasolutions.com )
TestON is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
... | 30.709677 | 72 | 0.72479 | from drivers.common.apidriver import API
class Controller( API ):
def __init__( self ):
super( API, self ).__init__()
| true | true |
1c3b3d147d89085e93dfaf79c785e932c04e4991 | 1,787 | py | Python | panko-6.0.0/panko/api/controllers/root.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | panko-6.0.0/panko/api/controllers/root.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | panko-6.0.0/panko/api/controllers/root.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | #
# Copyright 2012 New Dream Network, LLC (DreamHost)
#
# 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... | 34.365385 | 78 | 0.645215 |
import pecan
MEDIA_TYPE_JSON = 'application/vnd.openstack.telemetry-%s+json'
MEDIA_TYPE_XML = 'application/vnd.openstack.telemetry-%s+xml'
class VersionsController(object):
@pecan.expose('json')
def index(self):
base_url = pecan.request.application_url
available = [{'tag': 'v2', 'date': '20... | true | true |
1c3b3d2af96538f5b7bae8a9331d2391119e7274 | 566 | py | Python | exercicios/Lista2/Q27.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista2/Q27.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista2/Q27.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | #Escreva um programa que, dada a idade de um nadador,
#classifique-o em uma das seguintes categorias:
#Infantil A | 5 a 7
#Infantil B | 8 a 10
#Juvenil A | 11 a 13
#Juvenil B | 14 a 17
#Sênior | maiores de 18 anos
idade=int(input("Informe a idade: "))
if(5<=idade<=7):
print("A sua categoria eh Infantil A"... | 26.952381 | 54 | 0.664311 |
idade=int(input("Informe a idade: "))
if(5<=idade<=7):
print("A sua categoria eh Infantil A")
elif(8<=idade<=10):
print("A sua categoria eh Infantil B")
elif(11<=idade<=13):
print("A sua categoria eh Juvanil A")
elif(14<=idade<=17):
print("A sua categoria eh Juvanil A")
elif(18<=idade):
print("A ... | true | true |
1c3b3df0acf7e687f9e1ffd2ae0f8fb09f6435f5 | 43,926 | py | Python | nova/tests/unit/virt/libvirt/test_utils.py | huiweics/nova | ca4226cb87b4a271ee0ad72a6b93662feea3025e | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_utils.py | huiweics/nova | ca4226cb87b4a271ee0ad72a6b93662feea3025e | [
"Apache-2.0"
] | 1 | 2021-03-31T19:35:21.000Z | 2021-03-31T19:35:21.000Z | nova/tests/unit/virt/libvirt/test_utils.py | huiweics/nova | ca4226cb87b4a271ee0ad72a6b93662feea3025e | [
"Apache-2.0"
] | 1 | 2020-07-22T09:09:38.000Z | 2020-07-22T09:09:38.000Z | # Copyright 2012 NTT Data. All Rights Reserved.
# Copyright 2012 Yahoo! Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/li... | 42.938416 | 79 | 0.622593 |
import functools
import os
import tempfile
import ddt
import mock
import os_traits
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_utils import fileutils
from oslo_utils.fixture import uuidsentinel as uuids
import six
from nova.compute import utils as compute_utils
from nova import co... | true | true |
1c3b3e051d2c2972a081012a9b8758d9e7a1e042 | 6,503 | py | Python | src/silx/io/test/test_octaveh5.py | rnwatanabe/silx | b0395f4a06c048b7778dc04ada828edd195ef02d | [
"CC0-1.0",
"MIT"
] | 94 | 2016-03-04T17:25:53.000Z | 2022-03-18T18:05:23.000Z | src/silx/io/test/test_octaveh5.py | rnwatanabe/silx | b0395f4a06c048b7778dc04ada828edd195ef02d | [
"CC0-1.0",
"MIT"
] | 2,841 | 2016-01-21T09:06:49.000Z | 2022-03-18T14:53:56.000Z | src/silx/io/test/test_octaveh5.py | rnwatanabe/silx | b0395f4a06c048b7778dc04ada828edd195ef02d | [
"CC0-1.0",
"MIT"
] | 71 | 2015-09-30T08:35:35.000Z | 2022-03-16T07:16:28.000Z | # coding: utf-8
# /*##########################################################################
# Copyright (C) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# i... | 41.420382 | 106 | 0.629863 |
__authors__ = ["C. Nemoz", "H. Payno"]
__license__ = "MIT"
__date__ = "12/07/2016"
import unittest
import os
import tempfile
try:
from ..octaveh5 import Octaveh5
except ImportError:
Octaveh5 = None
@unittest.skipIf(Octaveh5 is None, "Could not import h5py")
class TestOctaveH5(unittest.TestCase):
@stati... | true | true |
1c3b3e2c456c705d4ff38427010b3887f3fb70e7 | 13,144 | py | Python | ctapipe/visualization/mpl_array.py | LukasBeiske/ctapipe | 8325700ca01cbae62733c2f41de4113013f18939 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/visualization/mpl_array.py | LukasBeiske/ctapipe | 8325700ca01cbae62733c2f41de4113013f18939 | [
"BSD-3-Clause"
] | null | null | null | ctapipe/visualization/mpl_array.py | LukasBeiske/ctapipe | 8325700ca01cbae62733c2f41de4113013f18939 | [
"BSD-3-Clause"
] | null | null | null | from itertools import cycle
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.lines import Line2D
from matplotlib.patches import Circle
from ctapipe.coordinates import GroundFr... | 34.229167 | 88 | 0.582395 | from itertools import cycle
import numpy as np
from astropy import units as u
from astropy.coordinates import Angle
from matplotlib import pyplot as plt
from matplotlib.collections import PatchCollection
from matplotlib.lines import Line2D
from matplotlib.patches import Circle
from ctapipe.coordinates import GroundFr... | true | true |
1c3b3f1f7568f2c59cc3550b3a969d29919ef84a | 38,530 | py | Python | fosscordself/webhook.py | discordtehe/fosscord.py-self | c8f5d14471af0e226870128eecd92ee67e4abb06 | [
"MIT"
] | null | null | null | fosscordself/webhook.py | discordtehe/fosscord.py-self | c8f5d14471af0e226870128eecd92ee67e4abb06 | [
"MIT"
] | null | null | null | fosscordself/webhook.py | discordtehe/fosscord.py-self | c8f5d14471af0e226870128eecd92ee67e4abb06 | [
"MIT"
] | 1 | 2022-01-12T02:09:08.000Z | 2022-01-12T02:09:08.000Z | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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 t... | 34.900362 | 120 | 0.591305 |
import logging
import asyncio
import json
import time
import re
from urllib.parse import quote as _uriquote
import aiohttp
from . import utils
from .errors import InvalidArgument, HTTPException, Forbidden, NotFound, DiscordServerError
from .message import Message
from .enums import try_enum, WebhookType
from .user ... | true | true |
1c3b3f2fffd739fa1a927fa3885d6fd5b1a33223 | 12,305 | py | Python | runtime/test/specs/V1_3/avg_pool_quant8_signed.mod.py | aosp-goes-brrbrr/packages_modules_NeuralNetworks | 87a14e21ce905ce7c4584fe9a53e4397a4d33c67 | [
"Apache-2.0"
] | 162 | 2018-03-30T00:57:00.000Z | 2022-01-28T08:04:55.000Z | runtime/test/specs/V1_3/avg_pool_quant8_signed.mod.py | aosp-goes-brrbrr/packages_modules_NeuralNetworks | 87a14e21ce905ce7c4584fe9a53e4397a4d33c67 | [
"Apache-2.0"
] | 1,347 | 2018-03-29T02:24:39.000Z | 2021-09-16T07:44:59.000Z | test/cts/tool/CTSConverter/src/nn/specs/V1_3/avg_pool_quant8_signed.mod.py | ibelem/webml-polyfill | aaf1ba4f5357eaf6e89bf9990f5bdfb543cd2bc2 | [
"Apache-2.0"
] | 71 | 2018-04-02T05:40:28.000Z | 2022-03-14T04:19:05.000Z | #
# Copyright (C) 2019 The Android Open Source Project
#
# 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 la... | 35.157143 | 122 | 0.615278 |
model = Model()
i1 = Input("op1", "TENSOR_QUANT8_ASYMM_SIGNED", "{1, 2, 2, 1}, 0.5f, -128")
cons1 = Int32Scalar("cons1", 1)
pad0 = Int32Scalar("pad0", 0)
act = Int32Scalar("act", 0)
o = Output("op3", "TENSOR_QUANT8_ASYMM_SIGNED", "{1, 2, 2, 1}, 0.5f, -128")
model = model.Operation("AVERAGE_POOL_2D", i1, pad0, pad0, pa... | true | true |
1c3b3fd8d6729793ea7481293b2a097ba62b056c | 556 | py | Python | test/date/test_time_util.py | jsrdzhk/hervenue | 698db40522f26983c63efa8d40fd461664340c95 | [
"MIT"
] | null | null | null | test/date/test_time_util.py | jsrdzhk/hervenue | 698db40522f26983c63efa8d40fd461664340c95 | [
"MIT"
] | null | null | null | test/date/test_time_util.py | jsrdzhk/hervenue | 698db40522f26983c63efa8d40fd461664340c95 | [
"MIT"
] | null | null | null | # !/usr/bin/env python3
# -*-coding:utf-8 -*-
"""
# File : test_time_util.py
# Time :2020/8/12 16:32
# Author :Rodney Cheung
"""
import unittest
from hervenue.date.time import TimeUtil
class TestTimeUtil(unittest.TestCase):
def test_format_seconds(self):
print(TimeUtil.format_seconds(100... | 20.592593 | 62 | 0.642086 |
import unittest
from hervenue.date.time import TimeUtil
class TestTimeUtil(unittest.TestCase):
def test_format_seconds(self):
print(TimeUtil.format_seconds(100, '{:d}h{:d}m{:d}s'))
def test_get_current_timestamp(self):
print(TimeUtil.get_current_timestamp())
def test_now(self):
... | true | true |
1c3b41bec652235497b2c6e34aa3a5e2c78c9305 | 870 | py | Python | sorting_searching/shell_sort/test_shell_sort.py | lvwuyunlifan/interactive-coding-challenges | 3a8ebbb4b337e5f4350f8166e101b9bb84228b1b | [
"Apache-2.0"
] | null | null | null | sorting_searching/shell_sort/test_shell_sort.py | lvwuyunlifan/interactive-coding-challenges | 3a8ebbb4b337e5f4350f8166e101b9bb84228b1b | [
"Apache-2.0"
] | null | null | null | sorting_searching/shell_sort/test_shell_sort.py | lvwuyunlifan/interactive-coding-challenges | 3a8ebbb4b337e5f4350f8166e101b9bb84228b1b | [
"Apache-2.0"
] | null | null | null | from nose.tools import assert_equal, assert_raises
class TestShellSort(object):
def test_shell_sort(self):
shell_sort = ShellSort()
print('None input')
assert_raises(TypeError, shell_sort.sort, None)
print('Empty input')
assert_equal(shell_sort.sort([]), [])
pri... | 24.857143 | 68 | 0.597701 | from nose.tools import assert_equal, assert_raises
class TestShellSort(object):
def test_shell_sort(self):
shell_sort = ShellSort()
print('None input')
assert_raises(TypeError, shell_sort.sort, None)
print('Empty input')
assert_equal(shell_sort.sort([]), [])
pri... | true | true |
1c3b4201dcb24ae42a1236b245c080443b02c477 | 4,984 | py | Python | src/python/module/nifty/graph/agglo/__init__.py | k-dominik/nifty | 067e137e9c1f33cccb22052b53ff0d75c288d667 | [
"MIT"
] | null | null | null | src/python/module/nifty/graph/agglo/__init__.py | k-dominik/nifty | 067e137e9c1f33cccb22052b53ff0d75c288d667 | [
"MIT"
] | null | null | null | src/python/module/nifty/graph/agglo/__init__.py | k-dominik/nifty | 067e137e9c1f33cccb22052b53ff0d75c288d667 | [
"MIT"
] | 1 | 2018-02-07T09:29:26.000Z | 2018-02-07T09:29:26.000Z | from __future__ import absolute_import
from . import _agglo as __agglo
from ._agglo import *
import numpy
__all__ = []
for key in __agglo.__dict__.keys():
__all__.append(key)
try:
__agglo.__dict__[key].__module__='nifty.graph.agglo'
except:
pass
from ...tools import makeDense as __makeDen... | 26.795699 | 114 | 0.588884 | from __future__ import absolute_import
from . import _agglo as __agglo
from ._agglo import *
import numpy
__all__ = []
for key in __agglo.__dict__.keys():
__all__.append(key)
try:
__agglo.__dict__[key].__module__='nifty.graph.agglo'
except:
pass
from ...tools import makeDense as __makeDen... | true | true |
1c3b4260dea513390afa15e7929a2b06413213e5 | 231 | py | Python | test.py | widodom/hello-world | 95a9e650b89bae2c2cd40fec82aff97a778bab6f | [
"MIT"
] | null | null | null | test.py | widodom/hello-world | 95a9e650b89bae2c2cd40fec82aff97a778bab6f | [
"MIT"
] | null | null | null | test.py | widodom/hello-world | 95a9e650b89bae2c2cd40fec82aff97a778bab6f | [
"MIT"
] | null | null | null |
def foo():
print('foo is running')
print("more print statements")
print('and more')
print('dangling')
def bar():
print('bar is running')
print('still in bar')
print('bar still running')
bar()
foo()
| 11 | 34 | 0.588745 |
def foo():
print('foo is running')
print("more print statements")
print('and more')
print('dangling')
def bar():
print('bar is running')
print('still in bar')
print('bar still running')
bar()
foo()
| true | true |
1c3b4272f1b549b9a0cd73b55c4038f19a4426a2 | 76 | py | Python | wd_extractor/adder.py | DuaneNielsen/wd_extractor | 128a189bacd0cd2d7f1fa598202b9c4e55f48e2f | [
"CC-BY-3.0"
] | null | null | null | wd_extractor/adder.py | DuaneNielsen/wd_extractor | 128a189bacd0cd2d7f1fa598202b9c4e55f48e2f | [
"CC-BY-3.0"
] | null | null | null | wd_extractor/adder.py | DuaneNielsen/wd_extractor | 128a189bacd0cd2d7f1fa598202b9c4e55f48e2f | [
"CC-BY-3.0"
] | null | null | null | class adder:
def add(self,first,second):
return first + second
| 15.2 | 31 | 0.631579 | class adder:
def add(self,first,second):
return first + second
| true | true |
1c3b43202c884d8374332b03a7837d2c4aced8cb | 1,177 | py | Python | venv/lib/python2.7/site-packages/pip/vendor/html5lib/trie/datrie.py | MissCatLady/AlarmEZ | 3942f0b9bb1f7eafb009b3a93df00320c7f74218 | [
"MIT"
] | 5 | 2015-05-04T16:11:56.000Z | 2018-09-13T22:03:55.000Z | venv/lib/python2.7/site-packages/pip/vendor/html5lib/trie/datrie.py | MissCatLady/AlarmEZ | 3942f0b9bb1f7eafb009b3a93df00320c7f74218 | [
"MIT"
] | 2 | 2015-06-21T17:38:11.000Z | 2015-06-22T20:54:42.000Z | venv/lib/python2.7/site-packages/pip/vendor/html5lib/trie/datrie.py | MissCatLady/AlarmEZ | 3942f0b9bb1f7eafb009b3a93df00320c7f74218 | [
"MIT"
] | 2 | 2017-10-11T16:47:08.000Z | 2021-09-04T20:11:50.000Z | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from pip.vendor.six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, tex... | 26.155556 | 66 | 0.64486 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from pip.vendor.six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, tex... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.