hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
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="ga... | 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... | 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__(... | 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, u... | 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, p... | 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 f... | 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 | s 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 block_diag
from scipy.special import factorial
fro... | 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:... | 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
c... | 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.... | true | true |
1c3b2bb00c59ad71b55ffebae59a735126005941 | 104,706 | py | Python | src/sage/schemes/elliptic_curves/ell_generic.py | bopopescu/classic_diff_geom | 2b1d88becbc8cb30962e0995cc78e429e0f5589f | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/elliptic_curves/ell_generic.py | bopopescu/classic_diff_geom | 2b1d88becbc8cb30962e0995cc78e429e0f5589f | [
"BSL-1.0"
] | null | null | null | src/sage/schemes/elliptic_curves/ell_generic.py | bopopescu/classic_diff_geom | 2b1d88becbc8cb30962e0995cc78e429e0f5589f | [
"BSL-1.0"
] | 1 | 2020-07-24T12:08:30.000Z | 2020-07-24T12:08:30.000Z | r"""
Elliptic curves over a general ring
Sage defines an elliptic curve over a ring `R` as a 'Weierstrass Model' with
five coefficients `[a_1,a_2,a_3,a_4,a_6]` in `R` given by
`y^2 + a_1 xy + a_3 y = x^3 +a_2 x^2 +a_4 x +a_6`.
Note that the (usual) scheme-theoretic definition of an elliptic curve over `R` would requ... | 35.159839 | 383 | 0.516809 | r"""
Elliptic curves over a general ring
Sage defines an elliptic curve over a ring `R` as a 'Weierstrass Model' with
five coefficients `[a_1,a_2,a_3,a_4,a_6]` in `R` given by
`y^2 + a_1 xy + a_3 y = x^3 +a_2 x^2 +a_4 x +a_6`.
Note that the (usual) scheme-theoretic definition of an elliptic curve over `R` would requ... | false | 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(St... | 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... | 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 imp... | 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',
'dj... | 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 '__unico... | 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']... | 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@i... | 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 KbAdvertSubjectVoucherRespo... | 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()
| 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 GraphR... | 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... | 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):
pr... | 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 ... | 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 | 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,... | 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 |
1c3b4068ce8272ab1a0085210fd4c6d310d5b885 | 29,823 | py | Python | scripts/calibrator.py | minkkang/caffe-1 | 1d0d1eae65991809a4e0fa94faf451187aaffdb7 | [
"BSD-2-Clause"
] | null | null | null | scripts/calibrator.py | minkkang/caffe-1 | 1d0d1eae65991809a4e0fa94faf451187aaffdb7 | [
"BSD-2-Clause"
] | null | null | null | scripts/calibrator.py | minkkang/caffe-1 | 1d0d1eae65991809a4e0fa94faf451187aaffdb7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# All modification made by Intel Corporation: Copyright (c) 2018 Intel Corporation
#
# All contributions by the University of California:
# Copyright (c) 2014, 2015, The Regents of the University of California (Regents)
# All rights reserved.
#
# All other contributions:
# Copyright (c) 2014,... | 45.81106 | 226 | 0.664688 |
import os
import sys
import copy
import argparse
pycaffe = os.path.split(os.path.realpath(__file__))[0] + '/../python'
sys.path.insert(0, pycaffe)
import caffe
from caffe.proto import caffe_pb2
import google.protobuf.text_format as txtf
import sampling
import numpy as np
int8_layer... | false | 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 |
1c3b43264146acffd4b9791e5ba180dcff39b787 | 3,442 | py | Python | endorsement/urls.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | 3 | 2017-10-16T17:19:32.000Z | 2019-07-31T22:31:48.000Z | endorsement/urls.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | 284 | 2016-06-17T18:21:31.000Z | 2022-03-21T16:55:03.000Z | endorsement/urls.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.urls import re_path
from userservice.views import support as userservice_override
from endorsement.views import page
from endorsement.views.accept import accept
from endorsement.views.support.endorser_search import Endors... | 51.373134 | 76 | 0.733295 |
from django.urls import re_path
from userservice.views import support as userservice_override
from endorsement.views import page
from endorsement.views.accept import accept
from endorsement.views.support.endorser_search import EndorserSearch
from endorsement.views.support.endorsee_search import EndorseeSearch
from en... | true | true |
1c3b43dfa126113a77aed9d9def8d973b850cef5 | 861 | py | Python | img2coe.py | VladLujerdeanu/Image-to-Coe-File | faab54003982ce5b53f89298a9057680a5b63e1c | [
"MIT"
] | 4 | 2021-03-19T16:21:05.000Z | 2022-02-01T18:19:10.000Z | img2coe.py | VladLujerdeanu/Image-to-Coe-File | faab54003982ce5b53f89298a9057680a5b63e1c | [
"MIT"
] | null | null | null | img2coe.py | VladLujerdeanu/Image-to-Coe-File | faab54003982ce5b53f89298a9057680a5b63e1c | [
"MIT"
] | null | null | null | import numpy as np
import sys
import os
from PIL import Image
def img2coe(path, index):
img = Image.open(path)
arr = np.array(img)
output_file = "img" + str(index) + ".coe"
f = open(output_file, "w")
f.write("memory_initialization_radix=2;\nmemory_initialization_vector=")
for line in arr:
... | 27.774194 | 104 | 0.547038 | import numpy as np
import sys
import os
from PIL import Image
def img2coe(path, index):
img = Image.open(path)
arr = np.array(img)
output_file = "img" + str(index) + ".coe"
f = open(output_file, "w")
f.write("memory_initialization_radix=2;\nmemory_initialization_vector=")
for line in arr:
... | true | true |
1c3b446d870b656182874f023654cee42a310142 | 192 | py | Python | commerce/auctions/admin.py | p-schlickmann/e-commerce | fecc1403dde898f1058662e642ed2678c4d7c224 | [
"MIT"
] | null | null | null | commerce/auctions/admin.py | p-schlickmann/e-commerce | fecc1403dde898f1058662e642ed2678c4d7c224 | [
"MIT"
] | null | null | null | commerce/auctions/admin.py | p-schlickmann/e-commerce | fecc1403dde898f1058662e642ed2678c4d7c224 | [
"MIT"
] | null | null | null | from django.contrib import admin
from . import models
admin.site.register(models.Item)
admin.site.register(models.User)
admin.site.register(models.Category)
admin.site.register(models.Bid)
| 19.2 | 36 | 0.807292 | from django.contrib import admin
from . import models
admin.site.register(models.Item)
admin.site.register(models.User)
admin.site.register(models.Category)
admin.site.register(models.Bid)
| true | true |
1c3b44a2d17a59f486047938d58c7aae75ab6375 | 23,160 | py | Python | Contents/scripts/scnexpl/explorer.py | mochio326/SceneExplorer | 1d93788014ce1eab2dc91258e3efc2c71b7c20cd | [
"MIT"
] | 7 | 2017-03-15T03:09:52.000Z | 2019-09-29T09:34:34.000Z | Contents/scripts/scnexpl/explorer.py | mochio326/SceneExplorer | 1d93788014ce1eab2dc91258e3efc2c71b7c20cd | [
"MIT"
] | null | null | null | Contents/scripts/scnexpl/explorer.py | mochio326/SceneExplorer | 1d93788014ce1eab2dc91258e3efc2c71b7c20cd | [
"MIT"
] | null | null | null | ## -*- coding: utf-8 -*-
import sys
import re
import os.path
import subprocess
from .vendor.Qt import QtCore, QtGui, QtWidgets
from .gui import explorer_ui
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin
import maya.OpenMaya as om
import maya.cmds as cmds
class SceneExplorerWeight(MayaQWidgetBaseMixin, ... | 34.311111 | 117 | 0.633679 | mport os.path
import subprocess
from .vendor.Qt import QtCore, QtGui, QtWidgets
from .gui import explorer_ui
from maya.app.general.mayaMixin import MayaQWidgetBaseMixin
import maya.OpenMaya as om
import maya.cmds as cmds
class SceneExplorerWeight(MayaQWidgetBaseMixin, QtWidgets.QDialog, explorer_ui.Ui_Form):
TI... | true | true |
1c3b44f4831afbfe369cc749854816caaf8baacb | 402 | py | Python | ros/build/camera_info_publisher/catkin_generated/pkg.develspace.context.pc.py | Emad-W/CarND-Capstone-Project | d058533d0815559918f4128051b12d47b995980d | [
"MIT"
] | null | null | null | ros/build/camera_info_publisher/catkin_generated/pkg.develspace.context.pc.py | Emad-W/CarND-Capstone-Project | d058533d0815559918f4128051b12d47b995980d | [
"MIT"
] | 10 | 2019-12-16T22:12:07.000Z | 2022-02-10T00:24:31.000Z | ros/build/camera_info_publisher/catkin_generated/pkg.develspace.context.pc.py | Emad-W/CarND-Capstone-Project | d058533d0815559918f4128051b12d47b995980d | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "camera_info_publisher"
PROJECT_SPACE_... | 44.666667 | 69 | 0.718905 |
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "camera_info_publisher"
PROJECT_SPACE_DIR = "/home/student/capstone/CarND-Capstone/ros/devel"
... | true | true |
1c3b45b01c0a93ee7b6ac0d613320683c9148afc | 1,648 | py | Python | test_Data_update_1.py | eduardcd/mas_fc | 990f0465081da52078fd28a95dbde535db073c18 | [
"MIT"
] | null | null | null | test_Data_update_1.py | eduardcd/mas_fc | 990f0465081da52078fd28a95dbde535db073c18 | [
"MIT"
] | null | null | null | test_Data_update_1.py | eduardcd/mas_fc | 990f0465081da52078fd28a95dbde535db073c18 | [
"MIT"
] | null | null | null | from code_1 import Data
from unittest import TestCase
def test_calculate1():
rgbd = [('knife',1, .99), ('scissor', 2, .65), ('spoon', 3, .33), ('spoon', 4, .80), ('keys', 5, .95)]
rgb = [('keys', 5, .95), ('spoon', 4, .99),('fork', 3, .99), ('scissor', 2, .95), ('knife',1, .55)]
data = Data(rgbd, rgb)
... | 43.368421 | 136 | 0.517597 | from code_1 import Data
from unittest import TestCase
def test_calculate1():
rgbd = [('knife',1, .99), ('scissor', 2, .65), ('spoon', 3, .33), ('spoon', 4, .80), ('keys', 5, .95)]
rgb = [('keys', 5, .95), ('spoon', 4, .99),('fork', 3, .99), ('scissor', 2, .95), ('knife',1, .55)]
data = Data(rgbd, rgb)
... | true | true |
1c3b46e3834dbde23cdba1ede29bd6d1494176a7 | 2,149 | py | Python | s3_tar/s3_mpu.py | STARInformatics/s3-tar | 20071e8acc6b8110624fac470d2e51a0b967df55 | [
"MIT"
] | 17 | 2020-02-12T00:14:54.000Z | 2022-03-25T17:53:06.000Z | s3_tar/s3_mpu.py | STARInformatics/s3-tar | 20071e8acc6b8110624fac470d2e51a0b967df55 | [
"MIT"
] | 9 | 2020-02-08T21:32:45.000Z | 2021-03-18T17:49:03.000Z | s3_tar/s3_mpu.py | STARInformatics/s3-tar | 20071e8acc6b8110624fac470d2e51a0b967df55 | [
"MIT"
] | 10 | 2020-03-23T06:53:35.000Z | 2022-01-04T11:52:45.000Z | import logging
logger = logging.getLogger(__name__)
class S3MPU:
def __init__(self, s3, target_bucket, target_key):
self.s3 = s3
self.target_bucket = target_bucket
self.target_key = target_key
self.parts_mapping = []
logger.info("Creating file {}".format(self.target_key)... | 29.847222 | 72 | 0.581201 | import logging
logger = logging.getLogger(__name__)
class S3MPU:
def __init__(self, s3, target_bucket, target_key):
self.s3 = s3
self.target_bucket = target_bucket
self.target_key = target_key
self.parts_mapping = []
logger.info("Creating file {}".format(self.target_key)... | true | true |
1c3b486cb56678a3a738379132713ae72357262c | 26,769 | py | Python | autoflow/feature_engineer/generate/autofeat/autofeat.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 49 | 2020-04-16T11:17:28.000Z | 2020-05-06T01:32:44.000Z | autoflow/feature_engineer/generate/autofeat/autofeat.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | null | null | null | autoflow/feature_engineer/generate/autofeat/autofeat.py | auto-flow/autoflow | f5903424ad8694d57741a0bd6dfeaba320ea6517 | [
"BSD-3-Clause"
] | 3 | 2020-04-17T00:53:24.000Z | 2020-04-23T03:04:26.000Z | # -*- coding: utf-8 -*-
# Author: Franziska Horn <cod3licious@gmail.com>
# License: MIT
from __future__ import unicode_literals, division, print_function, absolute_import
from builtins import range
from copy import copy
from typing import List, Optional
import numpy as np
import pandas as pd
import pint
from sklearn... | 51.085878 | 140 | 0.606859 |
from __future__ import unicode_literals, division, print_function, absolute_import
from builtins import range
from copy import copy
from typing import List, Optional
import numpy as np
import pandas as pd
import pint
from sklearn.base import BaseEstimator, TransformerMixin
from sklearn.ensemble import ExtraTreesC... | true | true |
1c3b489ac6f0e700b06e5ce05f81b8a4a447c5d4 | 1,525 | bzl | Python | test/com/google/javascript/jscomp/serialization/integration_tests.bzl | lukec611/closure-compiler | f2fa8b35b8127bfb9e8852963a534eafa324e0c6 | [
"Apache-2.0"
] | 6,240 | 2015-01-01T00:20:53.000Z | 2022-03-31T10:33:32.000Z | test/com/google/javascript/jscomp/serialization/integration_tests.bzl | lukec611/closure-compiler | f2fa8b35b8127bfb9e8852963a534eafa324e0c6 | [
"Apache-2.0"
] | 3,139 | 2015-01-03T02:13:16.000Z | 2022-03-31T16:44:22.000Z | test/com/google/javascript/jscomp/serialization/integration_tests.bzl | lukec611/closure-compiler | f2fa8b35b8127bfb9e8852963a534eafa324e0c6 | [
"Apache-2.0"
] | 1,272 | 2015-01-07T01:22:20.000Z | 2022-03-28T07:23:29.000Z | load("//tools/build_defs/js:rules.bzl", "js_binary")
def serialized_ast_file(name, ordered_srcs = []):
"""Creates a single serialized AST file from compiling all of the input files."""
jsast = name
binary_name = name + "_bin"
js_binary(
name = binary_name,
compiler = "//javascript/tools... | 33.888889 | 104 | 0.588852 | load("//tools/build_defs/js:rules.bzl", "js_binary")
def serialized_ast_file(name, ordered_srcs = []):
jsast = name
binary_name = name + "_bin"
js_binary(
name = binary_name,
compiler = "//javascript/tools/jscompiler:head",
compile = 1,
defs = [
"--language_out=N... | true | true |
1c3b494b32b82b353c8d58d2e884213ea3910e94 | 729 | py | Python | tests/test_config.py | flxbe/flumine | a03a0b55373f79c460b2baafa3f1b4068f2cb4da | [
"MIT"
] | null | null | null | tests/test_config.py | flxbe/flumine | a03a0b55373f79c460b2baafa3f1b4068f2cb4da | [
"MIT"
] | 24 | 2021-06-01T07:20:01.000Z | 2022-03-29T16:13:08.000Z | tests/test_config.py | lunswor/flumine | f0e7e6542942d00685ceb6d72951456684998739 | [
"MIT"
] | null | null | null | import unittest
from flumine import config
class ConfigTest(unittest.TestCase):
def test_init(self):
self.assertFalse(config.simulated)
self.assertIsInstance(config.hostname, str)
self.assertIsInstance(config.process_id, int)
self.assertIsNone(config.current_time)
self.ass... | 36.45 | 58 | 0.721536 | import unittest
from flumine import config
class ConfigTest(unittest.TestCase):
def test_init(self):
self.assertFalse(config.simulated)
self.assertIsInstance(config.hostname, str)
self.assertIsInstance(config.process_id, int)
self.assertIsNone(config.current_time)
self.ass... | true | true |
1c3b49fbde9909f298cfa3b82da488df0e433628 | 389 | py | Python | kuring/kuring/wsgi.py | rtubio/kuring | bceb7accbb1e99a66be8112f0e396d0a16896bb9 | [
"Apache-2.0"
] | null | null | null | kuring/kuring/wsgi.py | rtubio/kuring | bceb7accbb1e99a66be8112f0e396d0a16896bb9 | [
"Apache-2.0"
] | 1 | 2021-09-22T19:38:06.000Z | 2021-09-22T19:38:06.000Z | kuring/kuring/wsgi.py | rtubio/kuring | bceb7accbb1e99a66be8112f0e396d0a16896bb9 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for kuring 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/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.882353 | 78 | 0.784062 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kuring.settings')
application = get_wsgi_application()
| true | true |
1c3b4a36806beb973d99a320bab84a2c8338cef2 | 10,119 | bzl | Python | go/private/actions/link.bzl | aignas/rules_go | 2f3533598303e985110e6fff4f3adf2125d4750e | [
"Apache-2.0"
] | null | null | null | go/private/actions/link.bzl | aignas/rules_go | 2f3533598303e985110e6fff4f3adf2125d4750e | [
"Apache-2.0"
] | 1 | 2022-02-18T15:47:32.000Z | 2022-02-18T15:47:32.000Z | go/private/actions/link.bzl | aignas/rules_go | 2f3533598303e985110e6fff4f3adf2125d4750e | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 39.838583 | 106 | 0.658662 |
load(
"//go/private:common.bzl",
"as_set",
"has_shared_lib_extension",
)
load(
"//go/private:mode.bzl",
"LINKMODE_C_SHARED",
"LINKMODE_NORMAL",
"LINKMODE_PLUGIN",
"extld_from_cc_toolchain",
"extldflags_from_cc_toolchain",
)
load(
"//go/private:rpath.bzl",
"rpath... | true | true |
1c3b4a4e3e663c47a5fcc888a631a24a374932c2 | 2,249 | py | Python | examples/07-filter/05-render.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | 1 | 2017-03-19T16:56:46.000Z | 2017-03-19T16:56:46.000Z | examples/07-filter/05-render.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | null | null | null | examples/07-filter/05-render.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | null | null | null | import os, sys
sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics.context import *
from nodebox.graphics import *
from nodebox.graphics.shader import render, blur
# render invokes psyco, and old compiler I'll need to replace here
# The render() command executes a function with drawing commands
# in... | 34.6 | 78 | 0.692308 | import os, sys
sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics.context import *
from nodebox.graphics import *
from nodebox.graphics.shader import render, blur
# The render() command executes a function with drawing commands
# in an offscreen (i.e. hidden) canvas and returns an Image object.
# ... | true | true |
1c3b4b0d67207d18e3ba44a1ef87f6b19942597e | 15,842 | py | Python | tests/components/filter/test_sensor.py | dlintott/core | a6c83cc46a34084fdc4c0e7221b6ba493f82cbac | [
"Apache-2.0"
] | 1 | 2020-12-24T23:23:24.000Z | 2020-12-24T23:23:24.000Z | tests/components/filter/test_sensor.py | dlintott/core | a6c83cc46a34084fdc4c0e7221b6ba493f82cbac | [
"Apache-2.0"
] | 48 | 2021-01-06T07:02:41.000Z | 2022-03-31T06:10:45.000Z | tests/components/filter/test_sensor.py | dlintott/core | a6c83cc46a34084fdc4c0e7221b6ba493f82cbac | [
"Apache-2.0"
] | 2 | 2021-07-14T20:22:04.000Z | 2021-09-22T08:56:16.000Z | """The test for the data filter sensor platform."""
from datetime import timedelta
from os import path
from pytest import fixture
from homeassistant import config as hass_config
from homeassistant.components.filter.sensor import (
DOMAIN,
LowPassFilter,
OutlierFilter,
RangeFilter,
ThrottleFilter,
... | 32.00404 | 96 | 0.603585 | from datetime import timedelta
from os import path
from pytest import fixture
from homeassistant import config as hass_config
from homeassistant.components.filter.sensor import (
DOMAIN,
LowPassFilter,
OutlierFilter,
RangeFilter,
ThrottleFilter,
TimeSMAFilter,
TimeThrottleFilter,
)
from ho... | true | true |
1c3b4b384361661b0a0d69363bc38a617ec79aba | 1,415 | py | Python | hapic/error/serpyco.py | raphj/hapic | b169ee901005bbe535e27ec878a051c2c1226e43 | [
"MIT"
] | 20 | 2017-10-13T11:23:33.000Z | 2021-12-09T12:42:06.000Z | hapic/error/serpyco.py | raphj/hapic | b169ee901005bbe535e27ec878a051c2c1226e43 | [
"MIT"
] | 130 | 2017-10-10T15:09:13.000Z | 2021-12-30T10:36:08.000Z | hapic/error/serpyco.py | raphj/hapic | b169ee901005bbe535e27ec878a051c2c1226e43 | [
"MIT"
] | 7 | 2017-10-17T07:24:42.000Z | 2021-09-16T14:33:17.000Z | # coding: utf-8
import dataclasses
import typing
from hapic.error.main import DefaultErrorBuilder
from hapic.processor.main import ProcessValidationError
from hapic.type import TYPE_SCHEMA
@dataclasses.dataclass
class DefaultErrorSchema(object):
message: str
details: typing.Dict[str, typing.Any] = dataclasse... | 34.512195 | 97 | 0.719435 |
import dataclasses
import typing
from hapic.error.main import DefaultErrorBuilder
from hapic.processor.main import ProcessValidationError
from hapic.type import TYPE_SCHEMA
@dataclasses.dataclass
class DefaultErrorSchema(object):
message: str
details: typing.Dict[str, typing.Any] = dataclasses.field(default... | true | true |
1c3b4c1ef04754816e4ee8dd71bc0b72e79d526e | 672 | py | Python | bitirmetezi/venv/Lib/site-packages/plot/parameter/update.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3 | [
"MIT"
] | 1 | 2020-04-10T08:14:43.000Z | 2020-04-10T08:14:43.000Z | bitirmetezi/venv/Lib/site-packages/plot/parameter/update.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3 | [
"MIT"
] | 1 | 2016-11-30T20:37:27.000Z | 2016-12-12T11:55:50.000Z | bitirmetezi/venv/Lib/site-packages/plot/parameter/update.py | busraltun/IMPLEMENTATIONOFEYECONTROLLEDVIRTUALKEYBOARD | fa3a9b150419a17aa82f41b068a5d69d0ff0d0f3 | [
"MIT"
] | 1 | 2019-12-18T07:56:00.000Z | 2019-12-18T07:56:00.000Z | """
Return an updated parameter dictionary based on
user input dictionary.
"""
from typing import AnyStr, Dict
import os
from ..io.input.parse import parse
def update(user_config_file):
# type: (AnyStr) -> Dict
"""Return an updated parameter dictionary
Parse user configuration file and use the informatio... | 25.846154 | 60 | 0.721726 | from typing import AnyStr, Dict
import os
from ..io.input.parse import parse
def update(user_config_file):
here = os.path.dirname(os.path.realpath(__file__))
default_config_file = os.path.join(here, "all.json")
return parse(user_config_file, default_config_file)
| true | true |
1c3b4c2556d0ca6a4f8386459171ee3d3882f52c | 5,816 | py | Python | DSB3Tutorial/LUNA_train_unet.py | taoddiao/dr.b | 87f9ae4a5001e1a9248b0e19ad90aa252e426fe9 | [
"Apache-2.0"
] | 10 | 2017-12-15T03:56:56.000Z | 2020-03-17T03:54:49.000Z | DSB3Tutorial/LUNA_train_unet.py | taoddiao/dr.b | 87f9ae4a5001e1a9248b0e19ad90aa252e426fe9 | [
"Apache-2.0"
] | 3 | 2017-12-15T20:22:46.000Z | 2018-04-27T17:56:13.000Z | DSB3Tutorial/LUNA_train_unet.py | taoddiao/dr.b | 87f9ae4a5001e1a9248b0e19ad90aa252e426fe9 | [
"Apache-2.0"
] | 3 | 2017-12-09T10:47:15.000Z | 2019-10-17T16:03:48.000Z | from __future__ import print_function
import numpy as np
from keras.models import Model
from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D
from keras.optimizers import Adam
from keras.optimizers import SGD
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras impor... | 39.564626 | 92 | 0.682256 | from __future__ import print_function
import numpy as np
from keras.models import Model
from keras.layers import Input, merge, Convolution2D, MaxPooling2D, UpSampling2D
from keras.optimizers import Adam
from keras.optimizers import SGD
from keras.callbacks import ModelCheckpoint, LearningRateScheduler
from keras impor... | true | true |
1c3b4c35ea45da38f5085a7c3d225839dc29b221 | 5,952 | py | Python | simulator/game.py | Yuta1004/procon30-battle-simulator-py | dcd0bb34efab3201705ff2188c2fc62f6ac7bc09 | [
"MIT"
] | null | null | null | simulator/game.py | Yuta1004/procon30-battle-simulator-py | dcd0bb34efab3201705ff2188c2fc62f6ac7bc09 | [
"MIT"
] | null | null | null | simulator/game.py | Yuta1004/procon30-battle-simulator-py | dcd0bb34efab3201705ff2188c2fc62f6ac7bc09 | [
"MIT"
] | null | null | null | # Copylight(c) 2019 NakagamiYuta
# LICENCE : MIT
import numpy as np
import json
from simulator.common import flatten_2d, gen_2d_list
class Game:
"""
Gameクラス
Brief:
シミュレーター
"""
def __init__(self, board, agents):
"""
コンストラクタ
Params
----------
board... | 28.753623 | 112 | 0.514785 |
import numpy as np
import json
from simulator.common import flatten_2d, gen_2d_list
class Game:
def __init__(self, board, agents):
self.board = board
self.agents = agents
self.turn = 0
def set_action(self, team_id, agent_id, dx, dy, remove_panel=False):
if abs(dx) > 1 or a... | true | true |
1c3b4c5691828c47807f6cb8ed1b32e8d9038956 | 1,102 | py | Python | python/controls/progress/basic_progress.py | pglet/pglet-samples | ab47e797a4daccfa4779daa3d1fd1cc27d92e7f9 | [
"MIT"
] | null | null | null | python/controls/progress/basic_progress.py | pglet/pglet-samples | ab47e797a4daccfa4779daa3d1fd1cc27d92e7f9 | [
"MIT"
] | null | null | null | python/controls/progress/basic_progress.py | pglet/pglet-samples | ab47e797a4daccfa4779daa3d1fd1cc27d92e7f9 | [
"MIT"
] | null | null | null | import time
import pglet
from pglet import Progress, Text
with pglet.page("basic-progress") as page:
prog1 = Progress("Copying file1.txt to file2.txt", value=0, width="50%")
page.add(Text("Default Progress", size="xLarge"), prog1)
for i in range(0, 101):
prog1.value = i
prog1.update()
... | 23.446809 | 76 | 0.637931 | import time
import pglet
from pglet import Progress, Text
with pglet.page("basic-progress") as page:
prog1 = Progress("Copying file1.txt to file2.txt", value=0, width="50%")
page.add(Text("Default Progress", size="xLarge"), prog1)
for i in range(0, 101):
prog1.value = i
prog1.update()
... | true | true |
1c3b4cff38fbd3e0ac656b6c5d5470120e680caa | 9,275 | py | Python | tests/test_caper_workflow_opts.py | dfeinzeig/caper | 35a693448179674acfae95590e329ab5d1eea0b7 | [
"MIT"
] | null | null | null | tests/test_caper_workflow_opts.py | dfeinzeig/caper | 35a693448179674acfae95590e329ab5d1eea0b7 | [
"MIT"
] | null | null | null | tests/test_caper_workflow_opts.py | dfeinzeig/caper | 35a693448179674acfae95590e329ab5d1eea0b7 | [
"MIT"
] | null | null | null | import json
import os
from textwrap import dedent
import pytest
from caper.caper_workflow_opts import CaperWorkflowOpts
from caper.cromwell_backend import BACKEND_AWS, BACKEND_GCP
def test_create_file(tmp_path):
"""Test without docker/singularity.
"""
use_google_cloud_life_sciences = False
gcp_zones... | 30.610561 | 84 | 0.642372 | import json
import os
from textwrap import dedent
import pytest
from caper.caper_workflow_opts import CaperWorkflowOpts
from caper.cromwell_backend import BACKEND_AWS, BACKEND_GCP
def test_create_file(tmp_path):
use_google_cloud_life_sciences = False
gcp_zones = ['us-west-1', 'us-west-2']
slurm_partitio... | true | true |
1c3b4d30baa1124cda83549bee2b0a5d2cc42353 | 6,811 | py | Python | .ipynb_checkpoints/Model-checkpoint.py | acse-jl8920/IRP-Johnson | 2a70ab9b286726847cc5d5bb65232b2b241f4d5a | [
"MIT"
] | null | null | null | .ipynb_checkpoints/Model-checkpoint.py | acse-jl8920/IRP-Johnson | 2a70ab9b286726847cc5d5bb65232b2b241f4d5a | [
"MIT"
] | null | null | null | .ipynb_checkpoints/Model-checkpoint.py | acse-jl8920/IRP-Johnson | 2a70ab9b286726847cc5d5bb65232b2b241f4d5a | [
"MIT"
] | null | null | null | #coding=utf-8
import tensorflow as tf
import keras
from keras.models import *
from keras.layers import *
import numpy as np
from metrics import metrics
from losses import LOSS_FACTORY
from keras.callbacks import History
from keras.callbacks import ModelCheckpoint
def conv_block(input, filters):
out = Conv2D(filter... | 33.885572 | 119 | 0.56673 |
import tensorflow as tf
import keras
from keras.models import *
from keras.layers import *
import numpy as np
from metrics import metrics
from losses import LOSS_FACTORY
from keras.callbacks import History
from keras.callbacks import ModelCheckpoint
def conv_block(input, filters):
out = Conv2D(filters, kernel_siz... | true | true |
1c3b4de8c952d03489927337b1b07d56f5cdc1d5 | 106 | py | Python | regex_field/__init__.py | millarm/django-regex-field | f9f8f41d576ac78f36159ec9408d1cf65bdb9532 | [
"MIT"
] | 14 | 2015-06-01T19:29:02.000Z | 2021-12-23T14:33:51.000Z | regex_field/__init__.py | millarm/django-regex-field | f9f8f41d576ac78f36159ec9408d1cf65bdb9532 | [
"MIT"
] | 15 | 2015-03-27T14:40:28.000Z | 2021-11-16T13:36:33.000Z | regex_field/__init__.py | millarm/django-regex-field | f9f8f41d576ac78f36159ec9408d1cf65bdb9532 | [
"MIT"
] | 15 | 2015-03-27T13:38:16.000Z | 2021-12-23T14:33:53.000Z | # flake8: noqa
from .version import __version__
default_app_config = 'regex_field.apps.RegexFieldConfig'
| 21.2 | 56 | 0.820755 |
from .version import __version__
default_app_config = 'regex_field.apps.RegexFieldConfig'
| true | true |
1c3b4e50c4ef9848007a3e4dc4cfa4018dff5357 | 42,431 | py | Python | sympy/functions/elementary/complexes.py | hackman01/sympy | 4a74b6f1952b863dfbafc9e14557427e63698dcd | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/complexes.py | hackman01/sympy | 4a74b6f1952b863dfbafc9e14557427e63698dcd | [
"BSD-3-Clause"
] | null | null | null | sympy/functions/elementary/complexes.py | hackman01/sympy | 4a74b6f1952b863dfbafc9e14557427e63698dcd | [
"BSD-3-Clause"
] | null | null | null | from sympy.core import S, Add, Mul, sympify, Symbol, Dummy, Basic
from sympy.core.expr import Expr
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.core.logic import fuzzy_not, fuzzy_or
from sympy.core.numbers import pi... | 29.364014 | 86 | 0.55278 | from sympy.core import S, Add, Mul, sympify, Symbol, Dummy, Basic
from sympy.core.expr import Expr
from sympy.core.exprtools import factor_terms
from sympy.core.function import (Function, Derivative, ArgumentIndexError,
AppliedUndef)
from sympy.core.logic import fuzzy_not, fuzzy_or
from sympy.core.numbers import pi... | true | true |
1c3b4fa254f1daec3297d254064842c05b66f54d | 318 | py | Python | models/schemas.py | muneeb-bashir/Lost_and_Found | e6d8c9f4323e4e0ecf69afd6af9615ac6e48a522 | [
"Apache-2.0"
] | null | null | null | models/schemas.py | muneeb-bashir/Lost_and_Found | e6d8c9f4323e4e0ecf69afd6af9615ac6e48a522 | [
"Apache-2.0"
] | null | null | null | models/schemas.py | muneeb-bashir/Lost_and_Found | e6d8c9f4323e4e0ecf69afd6af9615ac6e48a522 | [
"Apache-2.0"
] | null | null | null | from pydantic import BaseModel
from datetime import date
class User(BaseModel):
name: str
email: str
password: str
contact :str
class Item(BaseModel):
name: str
description: str
lostlocation: str
foundlocation: str
status: bool
Date : date
user_id: int
| 16.736842 | 31 | 0.632075 | from pydantic import BaseModel
from datetime import date
class User(BaseModel):
name: str
email: str
password: str
contact :str
class Item(BaseModel):
name: str
description: str
lostlocation: str
foundlocation: str
status: bool
Date : date
user_id: int
| true | true |
1c3b50bde722640d7c94b1b392bc478bcaf503b5 | 1,193 | py | Python | 6/6.2/favorite_languages.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | 6/6.2/favorite_languages.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | 6/6.2/favorite_languages.py | liqiwa/python_work | 3d1198d5616b28a37fee7dfba5bbef0e1d489c2d | [
"Apache-2.0"
] | null | null | null | favorite_languages = {
'jen':'python',
'sarah':'c',
'edward':'ruby',
'phil':'python',}
print("Sarah`s favorite_language is "+str(favorite_languages['sarah'].title())+'.')
#6-1
people = {'name':'mm','xing':'he','age':'30','city':'sjz'}
print(people)
words = {'liebiao':'liebiao,yuansu jihe','yuanzu':'buk... | 27.744186 | 89 | 0.686505 | favorite_languages = {
'jen':'python',
'sarah':'c',
'edward':'ruby',
'phil':'python',}
print("Sarah`s favorite_language is "+str(favorite_languages['sarah'].title())+'.')
people = {'name':'mm','xing':'he','age':'30','city':'sjz'}
print(people)
words = {'liebiao':'liebiao,yuansu jihe','yuanzu':'bukebia... | true | true |
1c3b51b9bba5ad52ab6d1413235c5067c07ac3ac | 5,115 | py | Python | model/unet.py | shvetsiya/carvana | acc594cba53c44d577c9e3e326e0163eea8b4862 | [
"MIT"
] | 11 | 2018-01-28T04:22:57.000Z | 2018-12-20T10:09:40.000Z | model/unet.py | shvetsiya/carvana | acc594cba53c44d577c9e3e326e0163eea8b4862 | [
"MIT"
] | null | null | null | model/unet.py | shvetsiya/carvana | acc594cba53c44d577c9e3e326e0163eea8b4862 | [
"MIT"
] | 2 | 2017-10-04T00:58:10.000Z | 2019-02-14T17:47:25.000Z | import torch
from torch import nn
from torch.nn import functional as F
class Conv3BN(nn.Module):
"""A module which applies the following actions:
- convolution with 3x3 kernel;
- batch normalization (if enabled);
- ELU.
Attributes:
in_ch: Number of input channels.
out_c... | 35.275862 | 120 | 0.577517 | import torch
from torch import nn
from torch.nn import functional as F
class Conv3BN(nn.Module):
def __init__(self, in_ch: int, out_ch: int, bn=True):
super(Conv3BN, self).__init__()
self.conv = nn.Conv2d(in_ch, out_ch, 3, padding=1)
self.bn = nn.BatchNorm2d(out_ch) if bn else None
... | true | true |
1c3b52422aeca1ef8527235caf16ec3b660eddfb | 3,425 | py | Python | mdemo.py | vorticityxyz/Gaia-api | 04e2a9ee2448830df72156aecf432eda0c6eb504 | [
"MIT"
] | null | null | null | mdemo.py | vorticityxyz/Gaia-api | 04e2a9ee2448830df72156aecf432eda0c6eb504 | [
"MIT"
] | null | null | null | mdemo.py | vorticityxyz/Gaia-api | 04e2a9ee2448830df72156aecf432eda0c6eb504 | [
"MIT"
] | null | null | null | # Description:
#
# This example uses Vorticity gaia API's mf28pml operator to run a forward model.
# The operator takes a velocity model and returns a simulated shot record which
# is then plotted using matplotlib.
#
# mf28pml allows for larger velocity models and faster solving than f28pml
#
# Input parameters for... | 29.525862 | 103 | 0.649051 |
# The operator takes a velocity model and returns a simulated shot record which
# is then plotted using matplotlib.
#
# mf28pml allows for larger velocity models and faster solving than f28pml
#
# Input parameters for the operator is generated by the
# function generate_test_data() and is as follows:
#
# model - ... | true | true |
1c3b5276307a51b1eefd9095f0058c30e16f3a28 | 159 | py | Python | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_BoxCox/model_control_one_enabled_BoxCox_ConstantTrend_BestCycle_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['ConstantTrend'] , ['BestCycle'] , ['LSTM'] ); | 39.75 | 81 | 0.748428 | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['BoxCox'] , ['ConstantTrend'] , ['BestCycle'] , ['LSTM'] ); | true | true |
1c3b5355646cd2b8381429e96d194c9a69b6a3a1 | 2,638 | py | Python | src/spaceone/monitoring/manager/project_alert_config_manager.py | xellos00/monitoring | deb5363a2152e7b3f85a08d27bdede0e00023824 | [
"Apache-2.0"
] | null | null | null | src/spaceone/monitoring/manager/project_alert_config_manager.py | xellos00/monitoring | deb5363a2152e7b3f85a08d27bdede0e00023824 | [
"Apache-2.0"
] | null | null | null | src/spaceone/monitoring/manager/project_alert_config_manager.py | xellos00/monitoring | deb5363a2152e7b3f85a08d27bdede0e00023824 | [
"Apache-2.0"
] | null | null | null | import logging
from spaceone.core.manager import BaseManager
from spaceone.monitoring.error.project_alert_config import *
from spaceone.monitoring.model.project_alert_config_model import ProjectAlertConfig
_LOGGER = logging.getLogger(__name__)
class ProjectAlertConfigManager(BaseManager):
def __init__(self, *a... | 44.711864 | 109 | 0.723275 | import logging
from spaceone.core.manager import BaseManager
from spaceone.monitoring.error.project_alert_config import *
from spaceone.monitoring.model.project_alert_config_model import ProjectAlertConfig
_LOGGER = logging.getLogger(__name__)
class ProjectAlertConfigManager(BaseManager):
def __init__(self, *a... | true | true |
1c3b5466c6c835d5b8d3616e9c7fe92a30b00a93 | 732 | py | Python | Sanctuary/Cogs/Utils/database.py | LeoHartUK/Sanctuary | 8d1d2ddb3a18bcf62a0cecc47bf152f88c90d2b1 | [
"MIT"
] | null | null | null | Sanctuary/Cogs/Utils/database.py | LeoHartUK/Sanctuary | 8d1d2ddb3a18bcf62a0cecc47bf152f88c90d2b1 | [
"MIT"
] | null | null | null | Sanctuary/Cogs/Utils/database.py | LeoHartUK/Sanctuary | 8d1d2ddb3a18bcf62a0cecc47bf152f88c90d2b1 | [
"MIT"
] | 1 | 2018-10-01T12:44:24.000Z | 2018-10-01T12:44:24.000Z | import asyncpg
class DatabaseConnection(object):
config = None
def __init__(self):
self.db = None
async def __aenter__(self):
self.db = await self.get_database_connection()
return self
async def __aexit__(self, exc_type, exc, tb):
await self.db.close()
async def get_database_connection(self):
'''
... | 19.263158 | 82 | 0.704918 | import asyncpg
class DatabaseConnection(object):
config = None
def __init__(self):
self.db = None
async def __aenter__(self):
self.db = await self.get_database_connection()
return self
async def __aexit__(self, exc_type, exc, tb):
await self.db.close()
async def get_database_connection(self):
con... | true | true |
1c3b55432f94cbcc20756c830407214cf91aa54f | 3,566 | py | Python | demo/demo_dec.py | Shuai-Xie/RSRailway | f710b6720abd1a8356004bd0b1b4db4dab2592ab | [
"MIT"
] | 1 | 2020-10-22T09:33:58.000Z | 2020-10-22T09:33:58.000Z | demo/demo_dec.py | Shuai-Xie/RSRailway | f710b6720abd1a8356004bd0b1b4db4dab2592ab | [
"MIT"
] | null | null | null | demo/demo_dec.py | Shuai-Xie/RSRailway | f710b6720abd1a8356004bd0b1b4db4dab2592ab | [
"MIT"
] | null | null | null | """
地物检测,17类目标检测
"""
import os
# os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
# os.environ["CUDA_HOME"] = "/nfs/xs/local/cuda-10.2"
# os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import torch
import cv2
import matplotlib.pyplot as plt
from models.ctrbox_net import CTRBOX
from tqdm import tqdm
from datas... | 29.229508 | 113 | 0.620303 | import os
import torch
import cv2
import matplotlib.pyplot as plt
from models.ctrbox_net import CTRBOX
from tqdm import tqdm
from datasets.config.railway import dec_label_names
from utils.func_utils import *
from utils.decoder import DecDecoder
from utils.misc import *
from pprint import pprint
... | true | true |
1c3b55ddf826dcafe1ddb15f497f79a7db57b86f | 1,137 | py | Python | typish/functions/_common_ancestor.py | georgeharker/typish | 1c043beb74d89e62b10339a2a964f60ec175adfa | [
"MIT"
] | 16 | 2019-08-03T13:57:17.000Z | 2021-11-08T11:51:52.000Z | typish/functions/_common_ancestor.py | georgeharker/typish | 1c043beb74d89e62b10339a2a964f60ec175adfa | [
"MIT"
] | 27 | 2019-09-11T13:24:38.000Z | 2022-02-11T07:04:12.000Z | typish/functions/_common_ancestor.py | georgeharker/typish | 1c043beb74d89e62b10339a2a964f60ec175adfa | [
"MIT"
] | 7 | 2019-11-18T16:50:09.000Z | 2021-11-01T14:34:39.000Z | import typing
def common_ancestor(*args: object) -> type:
"""
Get the closest common ancestor of the given objects.
:param args: any objects.
:return: the ``type`` of the closest common ancestor of the given ``args``.
"""
return _common_ancestor(args, False)
def common_ancestor_of_types(*arg... | 30.72973 | 79 | 0.644679 | import typing
def common_ancestor(*args: object) -> type:
return _common_ancestor(args, False)
def common_ancestor_of_types(*args: type) -> type:
return _common_ancestor(args, True)
def _common_ancestor(args: typing.Sequence[object], types: bool) -> type:
from typish.functions._get_type import get_typ... | true | true |
1c3b56185a74e835a8e187ab844d383e4d9b1e36 | 3,378 | py | Python | test/MSVS/vs-10.0Exp-exec.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/MSVS/vs-10.0Exp-exec.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/MSVS/vs-10.0Exp-exec.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 29.373913 | 85 | 0.705151 |
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import sys
import TestSConsMSVS
test = TestSConsMSVS.TestSConsMSVS()
if sys.platform != 'win32':
msg = "Skipping Visual Studio test on non-Windows platform '%s'\n" % sys.platform
test.skip_test(msg)
msvs_versio... | true | true |
1c3b572e793165fe911d98ddd9cd2c94e5258db8 | 11,345 | py | Python | ps5_II.2_II.3.py | gerkamspiano/QuantMacro | f7e6e4ff7ae075d556f73cb1434c45652b4180cb | [
"MIT"
] | null | null | null | ps5_II.2_II.3.py | gerkamspiano/QuantMacro | f7e6e4ff7ae075d556f73cb1434c45652b4180cb | [
"MIT"
] | null | null | null | ps5_II.2_II.3.py | gerkamspiano/QuantMacro | f7e6e4ff7ae075d556f73cb1434c45652b4180cb | [
"MIT"
] | null | null | null | # Problem Set 5 - Germán Sánchez Arce
# In collaboration with María González
# Import packages
import numpy as np
from numpy import vectorize
from itertools import product
import matplotlib.pyplot as plt
import scipy as sp
from scipy.interpolate import BSpline
from scipy.interpolate import interp1d
#... | 22.781124 | 149 | 0.548876 |
import numpy as np
from numpy import vectorize
from itertools import product
import matplotlib.pyplot as plt
import scipy as sp
from scipy.interpolate import BSpline
from scipy.interpolate import interp1d
ro = 0.06
beta = 1/(1+ro)
w = 1
r = 0.04
gamma = 0.5
sigmay = 0.2
pi = np.array([((... | true | true |
1c3b574492692395aa10d6c247780a0fddbb2853 | 5,525 | py | Python | mmcls/models/losses/asymmetric_loss.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 1 | 2022-03-15T07:36:04.000Z | 2022-03-15T07:36:04.000Z | mmcls/models/losses/asymmetric_loss.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | null | null | null | mmcls/models/losses/asymmetric_loss.py | YuxinZou/mmclassification | 2037260ea6c98a3b115e97727e1151a1c2c32f7a | [
"Apache-2.0"
] | 1 | 2022-03-25T08:40:07.000Z | 2022-03-25T08:40:07.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from ..builder import LOSSES
from .utils import convert_to_one_hot, weight_reduce_loss
def asymmetric_loss(pred,
target,
weight=None,
gamma_pos=1.0,
gamma... | 36.833333 | 79 | 0.566878 |
import torch
import torch.nn as nn
from ..builder import LOSSES
from .utils import convert_to_one_hot, weight_reduce_loss
def asymmetric_loss(pred,
target,
weight=None,
gamma_pos=1.0,
gamma_neg=4.0,
clip=0.05,
... | true | true |
1c3b57690461d1837c56b4565a9ecc8958073025 | 7,896 | py | Python | python_modules/dagster/dagster/core/execution/context/compute.py | JBrVJxsc/dagster | 680aa23387308335eb0eccfa9241b26d10a2d627 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/context/compute.py | JBrVJxsc/dagster | 680aa23387308335eb0eccfa9241b26d10a2d627 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/execution/context/compute.py | JBrVJxsc/dagster | 680aa23387308335eb0eccfa9241b26d10a2d627 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod, abstractproperty
from typing import Any, Optional
from dagster import check
from dagster.core.definitions.dependency import Solid, SolidHandle
from dagster.core.definitions.mode import ModeDefinition
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core... | 31.710843 | 107 | 0.674772 | from abc import ABC, abstractmethod, abstractproperty
from typing import Any, Optional
from dagster import check
from dagster.core.definitions.dependency import Solid, SolidHandle
from dagster.core.definitions.mode import ModeDefinition
from dagster.core.definitions.pipeline import PipelineDefinition
from dagster.core... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.