hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73629463525a2647b03c609ca5952eb27adc3d4 | 7,419 | py | Python | Scripts/Plotting/Posteriors_cosmo_model1/Posteriors_cosmo_model1_alternative_dust.py | LBJ-Wade/GALLUMI_public | dbef3ff1ae6934c9551a44cbbe0270e2f17f5527 | [
"MIT"
] | 1 | 2021-12-15T00:17:15.000Z | 2021-12-15T00:17:15.000Z | Scripts/Plotting/Posteriors_cosmo_model1/Posteriors_cosmo_model1_alternative_dust.py | NNSSA/GALLUMI_public | 4529ab32ccfc281e5976f482fe556b672b8f464f | [
"MIT"
] | null | null | null | Scripts/Plotting/Posteriors_cosmo_model1/Posteriors_cosmo_model1_alternative_dust.py | NNSSA/GALLUMI_public | 4529ab32ccfc281e5976f482fe556b672b8f464f | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import glob
from matplotlib import patches as mpatches
import scipy.ndimage
from scipy.interpolate import PchipInterpolator
plt.style.use("../template.mplstyle")
# purple - green - darkgoldenrod - blue - red
colors = ['purple', '#306B37', 'darkgoldenrod', '#3F7BB... | 45.515337 | 244 | 0.669632 | import numpy as np
from matplotlib import pyplot as plt
import glob
from matplotlib import patches as mpatches
import scipy.ndimage
from scipy.interpolate import PchipInterpolator
plt.style.use("../template.mplstyle")
colors = ['purple', '#306B37', 'darkgoldenrod', '#3F7BB6', '#BF4145']
linestyles = [(0, (1,1.05)), (0... | true | true |
f7362a6ca3d104844807c89068693be7e4cdaf8b | 346 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py | jalauzon-msft/azure-sdk-for-python | 15967f5c6d3376f2334a382486ba86339786e028 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/_version.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | 38.444444 | 76 | 0.416185 |
VERSION = "27.1.0"
| true | true |
f7362b15d038c90e57d13b0b966653c28ef74792 | 3,507 | py | Python | train.py | Yugeeth/chat-bot | 3198fb160f743c7be1f377d2febb889423da8c06 | [
"MIT"
] | null | null | null | train.py | Yugeeth/chat-bot | 3198fb160f743c7be1f377d2febb889423da8c06 | [
"MIT"
] | null | null | null | train.py | Yugeeth/chat-bot | 3198fb160f743c7be1f377d2febb889423da8c06 | [
"MIT"
] | null | null | null | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('intents.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy... | 27.186047 | 75 | 0.633875 | import numpy as np
import random
import json
import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader
from nltk_utils import bag_of_words, tokenize, stem
from model import NeuralNet
with open('intents.json', 'r') as f:
intents = json.load(f)
all_words = []
tags = []
xy... | true | true |
f7362b1d3b7934ae1c2a4ac2d3bcb7a2674d48d6 | 1,310 | py | Python | para_averaging.py | TurkuNLP/paraphrase-classification | 625f0cf5223ecff9d25c2a4f558ca39fa5ecc794 | [
"Apache-2.0"
] | null | null | null | para_averaging.py | TurkuNLP/paraphrase-classification | 625f0cf5223ecff9d25c2a4f558ca39fa5ecc794 | [
"Apache-2.0"
] | null | null | null | para_averaging.py | TurkuNLP/paraphrase-classification | 625f0cf5223ecff9d25c2a4f558ca39fa5ecc794 | [
"Apache-2.0"
] | null | null | null | import torch.nn.functional as F
import torch
import para_model
class ParaAvgModel(para_model.PARAModel):
def __init__(self, **args):
super().__init__(**args)
# self.drop_layer=torch.nn.Dropout(p=0.2)
self.cls_layer=torch.nn.Linear(self.bert.config.hidden_size*5, args['num_classes'])
d... | 43.666667 | 129 | 0.655725 | import torch.nn.functional as F
import torch
import para_model
class ParaAvgModel(para_model.PARAModel):
def __init__(self, **args):
super().__init__(**args)
self.cls_layer=torch.nn.Linear(self.bert.config.hidden_size*5, args['num_classes'])
def forward(self, batch):
input_ids... | true | true |
f7362b4bfc9f1a5b48252b4883e71f75146af047 | 15,417 | py | Python | mne/viz/circle.py | joewalter/mne-python | b0629bea7f5e8e94d9e2e889f45a35f9657e6dbc | [
"BSD-3-Clause"
] | null | null | null | mne/viz/circle.py | joewalter/mne-python | b0629bea7f5e8e94d9e2e889f45a35f9657e6dbc | [
"BSD-3-Clause"
] | null | null | null | mne/viz/circle.py | joewalter/mne-python | b0629bea7f5e8e94d9e2e889f45a35f9657e6dbc | [
"BSD-3-Clause"
] | null | null | null | """Functions to plot on circle as for connectivity
"""
from __future__ import print_function
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
#
# License: Simplified BSD
from itertools i... | 37.23913 | 79 | 0.621846 | from __future__ import print_function
from itertools import cycle
from functools import partial
import numpy as np
from .utils import plt_show
from ..externals.six import string_types
def circular_layout(node_names, node_order, start_pos=90, start_between=True,
group_boundaries=None, group_se... | true | true |
f7362b4e7693e7a3993c8f04eaae12595182ff80 | 34 | py | Python | turkishsuffix/__init__.py | ugur-zongur/turkishsuffix | f013e34f3094b5357244b1fd426ce9594c9c36ab | [
"MIT"
] | 8 | 2018-09-12T03:45:49.000Z | 2021-03-05T15:55:11.000Z | turkishsuffix/__init__.py | ugur-zongur/turkishsuffix | f013e34f3094b5357244b1fd426ce9594c9c36ab | [
"MIT"
] | 1 | 2020-04-07T16:06:12.000Z | 2020-04-07T16:06:12.000Z | turkishsuffix/__init__.py | ugur-zongur/turkishsuffix | f013e34f3094b5357244b1fd426ce9594c9c36ab | [
"MIT"
] | 2 | 2018-03-02T11:08:33.000Z | 2020-03-12T22:10:00.000Z | from .suffix import turkishSuffix
| 17 | 33 | 0.852941 | from .suffix import turkishSuffix
| true | true |
f7362c07e55a424db3a7dda53b5b90643a1ec703 | 9,664 | py | Python | lib/airflow/airflow/operators/subdag.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | lib/airflow/airflow/operators/subdag.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 153 | 2021-10-15T05:23:46.000Z | 2022-02-23T06:07:10.000Z | lib/airflow/airflow/operators/subdag.py | SteNicholas/ai-flow | 2c70547981f1516f0e37bbe6936a1b7cccd31822 | [
"Apache-2.0"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 41.835498 | 105 | 0.640625 | from enum import Enum
from typing import Dict, Optional
from sqlalchemy.orm.session import Session
from airflow.api.common.experimental.get_task_instance import get_task_instance
from airflow.exceptions import AirflowException, TaskInstanceNotFound
from airflow.models import DagRun
from airflow.models.dag import DAG,... | true | true |
f7362d25cfa413edc1cc0f2e3479ec9ea1277b43 | 367 | py | Python | 1_The_Basics/1_1_Welcome/main.py | Aurora-College-SDD-2022/Python4SDD | 068b74bafd0c5fda2d9a99dc694911419d67b28a | [
"CC0-1.0"
] | null | null | null | 1_The_Basics/1_1_Welcome/main.py | Aurora-College-SDD-2022/Python4SDD | 068b74bafd0c5fda2d9a99dc694911419d67b28a | [
"CC0-1.0"
] | 3 | 2021-01-03T11:02:03.000Z | 2021-01-03T11:03:15.000Z | 1_The_Basics/1_1_Welcome/main.py | Aurora-College-SDD-2022/Python4SDD | 068b74bafd0c5fda2d9a99dc694911419d67b28a | [
"CC0-1.0"
] | 1 | 2021-02-18T22:05:16.000Z | 2021-02-18T22:05:16.000Z | """ your first python program.
Replace the words 'look at me I am coding' with your own message
to let the world know you are now an apprentice code monkey.
"""
def print_message():
"""prints a simple message."""
print("look at me I am coding")
#Ignore everything below this line...we will talk about it later... | 28.230769 | 64 | 0.708447 |
def print_message():
print("look at me I am coding")
if __name__ == "__main__":
print_message() | true | true |
f7362d59a01649e753aafc6708a779ef76437b4c | 8,296 | py | Python | python/GafferSceneUI/OutputsUI.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 561 | 2016-10-18T04:30:48.000Z | 2022-03-30T06:52:04.000Z | python/GafferSceneUI/OutputsUI.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 1,828 | 2016-10-14T19:01:46.000Z | 2022-03-30T16:07:19.000Z | python/GafferSceneUI/OutputsUI.py | ddesmond/gaffer | 4f25df88103b7893df75865ea919fb035f92bac0 | [
"BSD-3-Clause"
] | 120 | 2016-10-18T15:19:13.000Z | 2021-12-20T16:28:23.000Z | ##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of so... | 31.30566 | 114 | 0.674301 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
import functools
import imath
import IECore
import IECoreScene
import Gaffer
import GafferUI
import GafferScene
import GafferSceneUI
Gaffer.Metadata.registerNode(
GafferScene.Outputs,
"description",
"""
Defines the image outputs to... | true | true |
f7362d686b031b37aec567847d3c0a6b7d8027e9 | 1,864 | py | Python | tradebook/users/models.py | isuryanarayanan/tradebook-backend | 86c9e3c5adccb13b95945604c3d1e5c43066532c | [
"MIT"
] | null | null | null | tradebook/users/models.py | isuryanarayanan/tradebook-backend | 86c9e3c5adccb13b95945604c3d1e5c43066532c | [
"MIT"
] | null | null | null | tradebook/users/models.py | isuryanarayanan/tradebook-backend | 86c9e3c5adccb13b95945604c3d1e5c43066532c | [
"MIT"
] | null | null | null | """ User account models """
from django.db import models
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.base_user import BaseUserManager
class UserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, use... | 35.846154 | 84 | 0.688841 | from django.db import models
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.base_user import BaseUserManager
class UserManager(BaseUserManager):
use_in_migrations = True
def _create_user(self, username, email, password, **ex... | true | true |
f7362de671c7775a19073b3d25d77d55bee0b8d2 | 1,602 | py | Python | test/test_instructions/test_invocations.py | ronyhe/pyjvm | bb15bed8719335c09779f95d4bc16947b7bb7b98 | [
"MIT"
] | 15 | 2018-07-31T11:25:18.000Z | 2021-07-28T09:13:21.000Z | test/test_instructions/test_invocations.py | ronyhe/pyjvm | bb15bed8719335c09779f95d4bc16947b7bb7b98 | [
"MIT"
] | null | null | null | test/test_instructions/test_invocations.py | ronyhe/pyjvm | bb15bed8719335c09779f95d4bc16947b7bb7b98 | [
"MIT"
] | 1 | 2021-07-22T07:36:23.000Z | 2021-07-22T07:36:23.000Z | from jawa.constants import ConstantPool
from jawa.util.bytecode import Instruction
from pyjvm.core.actions import Pop, Invoke
from pyjvm.core.class_loaders import FixedClassLoader
from pyjvm.core.jvm_class import JvmClass, BytecodeMethod, MethodKey
from pyjvm.core.jvm_types import Integer, RootObjectType
from test.uti... | 27.62069 | 78 | 0.673533 | from jawa.constants import ConstantPool
from jawa.util.bytecode import Instruction
from pyjvm.core.actions import Pop, Invoke
from pyjvm.core.class_loaders import FixedClassLoader
from pyjvm.core.jvm_class import JvmClass, BytecodeMethod, MethodKey
from pyjvm.core.jvm_types import Integer, RootObjectType
from test.uti... | true | true |
f7362deaf881659f32749a483965edb06eda5a8f | 33,921 | py | Python | src/qtt/instrument_drivers/virtual_awg.py | jsaez8/qtt | fa6497ace86a255f33a2192ba01d063d07d6895e | [
"MIT"
] | null | null | null | src/qtt/instrument_drivers/virtual_awg.py | jsaez8/qtt | fa6497ace86a255f33a2192ba01d063d07d6895e | [
"MIT"
] | null | null | null | src/qtt/instrument_drivers/virtual_awg.py | jsaez8/qtt | fa6497ace86a255f33a2192ba01d063d07d6895e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 31 13:04:09 2016
@author: diepencjv
"""
# %%
import numpy as np
import scipy.signal
import logging
import warnings
import qcodes
from qcodes import Instrument
from qcodes.plots.pyqtgraph import QtPlot
from qcodes.data.data_array import DataArray
import qtt
import qtt.ut... | 41.774631 | 157 | 0.60296 |
import numpy as np
import scipy.signal
import logging
import warnings
import qcodes
from qcodes import Instrument
from qcodes.plots.pyqtgraph import QtPlot
from qcodes.data.data_array import DataArray
import qtt
import qtt.utilities.tools
logger = logging.getLogger(__name__)
class virtual_awg(Instrument):
def... | true | true |
f7362e1dc422d449f05e6af959692365df74ce49 | 5,374 | py | Python | artic/deprecated/plot_amplicon_depth.py | MarkusHaak/fieldbioinformatics | 3d291477a3d84968816c8e57e6078fc80135f422 | [
"MIT"
] | 72 | 2018-12-21T22:48:50.000Z | 2022-02-24T17:04:53.000Z | artic/deprecated/plot_amplicon_depth.py | MarkusHaak/fieldbioinformatics | 3d291477a3d84968816c8e57e6078fc80135f422 | [
"MIT"
] | 70 | 2020-02-05T13:39:09.000Z | 2022-03-29T01:47:19.000Z | artic/deprecated/plot_amplicon_depth.py | MarkusHaak/fieldbioinformatics | 3d291477a3d84968816c8e57e6078fc80135f422 | [
"MIT"
] | 54 | 2019-03-11T13:33:21.000Z | 2022-03-21T09:27:50.000Z | #!/usr/bin/env python3
"""
Plot the mean read depth per amplicon.
This has been written for use in the ARTIC pipeline so there are no file checks - it assumes the following:
* the primer scheme is in ARTIC format
* the input depth files are in the format: `chrom\treadgroup\tposition\tdepth
* readgroup equates to p... | 34.896104 | 116 | 0.592668 |
from .vcftagprimersites import read_bed_file
import sys
import pandas as pd
import numpy as np
import argparse
import os
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
import seaborn as sns
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def go(args):
primerScheme = read_bed_file(args.... | true | true |
f736303816e77fc8b6b0357f24619105dad9aa31 | 1,043 | py | Python | 2_Scraper-Scripts/RunThis.py | kshahnazari1998/SociaGrow-Public | 54042634ad8d16ea044bfd1fe265d68e1d74102b | [
"MIT"
] | null | null | null | 2_Scraper-Scripts/RunThis.py | kshahnazari1998/SociaGrow-Public | 54042634ad8d16ea044bfd1fe265d68e1d74102b | [
"MIT"
] | null | null | null | 2_Scraper-Scripts/RunThis.py | kshahnazari1998/SociaGrow-Public | 54042634ad8d16ea044bfd1fe265d68e1d74102b | [
"MIT"
] | null | null | null | import subprocess
import time
from VpnConnect import VpnConnects
vpc = VpnConnects()
while True:
time.sleep(10)
processf2 = subprocess.Popen(["python", "Targetaccountstatus.py"])
time.sleep(3600)
processf2.kill()
# Scrape User
processmain = subprocess.Popen(["python", "Ma... | 24.255814 | 71 | 0.634708 | import subprocess
import time
from VpnConnect import VpnConnects
vpc = VpnConnects()
while True:
time.sleep(10)
processf2 = subprocess.Popen(["python", "Targetaccountstatus.py"])
time.sleep(3600)
processf2.kill()
processmain = subprocess.Popen(["python", "ManagerAdmin.py"]... | true | true |
f73632ee2a6251e65ea96df144d8af26abd3cbc3 | 1,818 | py | Python | python/heliosUpdateTargetSecretKey/heliosUpdateTargetSecretKey.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | python/heliosUpdateTargetSecretKey/heliosUpdateTargetSecretKey.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | python/heliosUpdateTargetSecretKey/heliosUpdateTargetSecretKey.py | ped998/scripts | 0dcaaf47f9676210e1c972a5d59d8d0de82a1d93 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Helios Update Secret Key for External Targets"""
from pyhesity import *
from datetime import datetime
import getpass
### command line arguments
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-pwd', '-... | 35.647059 | 121 | 0.636964 |
from pyhesity import *
from datetime import datetime
import getpass
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-u', '--username', type=str, default='helios')
parser.add_argument('-pwd', '--password', type=str)
parser.add_argument('-a', '--accesskey', type=str, required=True)
parser.add_ar... | true | true |
f73632faf3e8e654e58ba098197bb5b21ddef5a6 | 6,133 | py | Python | managesf/controllers/api/v2/base.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | 1 | 2018-08-02T23:30:03.000Z | 2018-08-02T23:30:03.000Z | managesf/controllers/api/v2/base.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | 1 | 2021-12-13T18:24:10.000Z | 2021-12-13T20:10:39.000Z | managesf/controllers/api/v2/base.py | softwarefactory-project/managesf | 7018d041291f50b90e782ca31d0cfc67abd10170 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2017 Red Hat
#
# 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 writin... | 38.093168 | 79 | 0.608022 |
import logging
import os.path
import re
from pecan import conf
from pecan import request, response, abort, expose
from pecan.rest import RestController
from managesf.model.yamlbkd.engine import SFResourceBackendEngine
from managesf import policy
from managesf.model import SFUserCRUD
from git.exc import GitCommandEr... | true | true |
f73633465de3445622fe64746dfb0a3abd0dc8d9 | 4,477 | py | Python | sponge-kb/sponge-kb-mpd-mpc/src/main/resources/sponge/mpd-mpc/mpd_mpc_player.py | mnpas/sponge | 7190f23ae888bbef49d0fbb85157444d6ea48bcd | [
"Apache-2.0"
] | 9 | 2017-12-16T21:48:57.000Z | 2022-01-06T12:22:24.000Z | sponge-kb/sponge-kb-mpd-mpc/src/main/resources/sponge/mpd-mpc/mpd_mpc_player.py | mnpas/sponge | 7190f23ae888bbef49d0fbb85157444d6ea48bcd | [
"Apache-2.0"
] | 3 | 2020-12-18T11:56:46.000Z | 2022-03-31T18:37:10.000Z | sponge-kb/sponge-kb-mpd-mpc/src/main/resources/sponge/mpd-mpc/mpd_mpc_player.py | mnpas/sponge | 7190f23ae888bbef49d0fbb85157444d6ea48bcd | [
"Apache-2.0"
] | 2 | 2019-12-29T16:08:32.000Z | 2020-06-15T14:05:34.000Z | """
Sponge Knowledge Base
MPD player.
"""
class MpdPlayer(Action):
def onConfigure(self):
self.withLabel("Player").withDescription("The MPD player.")
self.withArgs([
# The song info arguments.
StringType("song").withLabel("Song").withNullable().withReadOnly()
... | 58.142857 | 118 | 0.624972 |
class MpdPlayer(Action):
def onConfigure(self):
self.withLabel("Player").withDescription("The MPD player.")
self.withArgs([
StringType("song").withLabel("Song").withNullable().withReadOnly()
.withProvided(ProvidedMeta().withValue()),
StringType("a... | true | true |
f7363416c8ea9009adc45b2b90d259e589d247e0 | 14,015 | py | Python | gsom.py | cperales/pygsom | ac4d4818f441d862cb5183e1d2ea814e3f805759 | [
"MIT"
] | null | null | null | gsom.py | cperales/pygsom | ac4d4818f441d862cb5183e1d2ea814e3f805759 | [
"MIT"
] | null | null | null | gsom.py | cperales/pygsom | ac4d4818f441d862cb5183e1d2ea814e3f805759 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015 Philipp Ludwig <git@philippludwig.net>
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 ... | 36.028278 | 99 | 0.577595 |
from math import log, exp
import itertools
import math
import random
import scipy
class GSOMNode:
R = random.Random()
def __init__(self, dim, x, y, data):
self.weights = scipy.array([self.R.random() for _ in range(dim)])
self.error = 0.0
self.it = 0
... | true | true |
f736343fd5da597b2fb04dc9aa414c2b0598f993 | 4,724 | py | Python | elmerbot/commands/search.py | scott-hand/elmerbot | cb356da60dcf7d6b6d3bef22341765c043e48f87 | [
"MIT"
] | null | null | null | elmerbot/commands/search.py | scott-hand/elmerbot | cb356da60dcf7d6b6d3bef22341765c043e48f87 | [
"MIT"
] | null | null | null | elmerbot/commands/search.py | scott-hand/elmerbot | cb356da60dcf7d6b6d3bef22341765c043e48f87 | [
"MIT"
] | null | null | null | import discord
import string
from elmerbot.commands import ElmerCommand
__all__ = ["SearchCommand", "InfoCommand"]
class SearchCommand(ElmerCommand):
command = "search"
description = (
"Search for a whisky by name. Optionally put a number of results to limit it to in front of "
"your query.\... | 40.033898 | 117 | 0.556308 | import discord
import string
from elmerbot.commands import ElmerCommand
__all__ = ["SearchCommand", "InfoCommand"]
class SearchCommand(ElmerCommand):
command = "search"
description = (
"Search for a whisky by name. Optionally put a number of results to limit it to in front of "
"your query.\... | true | true |
f736354e5a0f20eea35eceff7914e22c35491058 | 7,259 | py | Python | tests/test_grid.py | eEcoLiDAR/lcMacroPipeline | 91709f93ef53a3e453f0ce967e1094688688f684 | [
"Apache-2.0"
] | 2 | 2021-02-17T14:41:50.000Z | 2021-04-07T12:06:21.000Z | tests/test_grid.py | eEcoLiDAR/lcMacroPipeline | 91709f93ef53a3e453f0ce967e1094688688f684 | [
"Apache-2.0"
] | 16 | 2020-03-11T08:39:46.000Z | 2020-05-20T10:42:29.000Z | tests/test_grid.py | eEcoLiDAR/Laserfarm | 91709f93ef53a3e453f0ce967e1094688688f684 | [
"Apache-2.0"
] | 2 | 2020-07-06T08:18:56.000Z | 2020-08-19T12:00:26.000Z | from pathlib import Path
import unittest
import numpy as np
import pylas
from laserfarm.grid import Grid
try:
import matplotlib
matplotlib_available = True
except ModuleNotFoundError:
matplotlib_available = False
if matplotlib_available:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
cla... | 35.067633 | 87 | 0.573908 | from pathlib import Path
import unittest
import numpy as np
import pylas
from laserfarm.grid import Grid
try:
import matplotlib
matplotlib_available = True
except ModuleNotFoundError:
matplotlib_available = False
if matplotlib_available:
matplotlib.use('Agg')
import matplotlib.pyplot as plt
cla... | true | true |
f73635595a57c8cdfe5c9fda02943fccf1922333 | 2,431 | py | Python | examples/crud_rest_api/config.py | NeolithEra/Flask-AppBuilder | d9561bf89d925a2f5d74c226318884733b52718f | [
"BSD-3-Clause"
] | 3,862 | 2015-01-01T11:59:24.000Z | 2022-03-31T19:23:55.000Z | examples/crud_rest_api/config.py | NeolithEra/Flask-AppBuilder | d9561bf89d925a2f5d74c226318884733b52718f | [
"BSD-3-Clause"
] | 1,566 | 2015-01-01T23:26:11.000Z | 2022-03-31T16:23:08.000Z | examples/crud_rest_api/config.py | NeolithEra/Flask-AppBuilder | d9561bf89d925a2f5d74c226318884733b52718f | [
"BSD-3-Clause"
] | 1,352 | 2015-01-02T10:45:59.000Z | 2022-03-26T20:56:48.000Z | import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
OPENID_PROVIDERS = [
{"name": "Google", "url": "https://www.google.com/accounts/o8/id"},
{"name": "Yahoo", "url": "https://me.yahoo.com"},
{"name": "AOL", "url": "http://open... | 30.772152 | 84 | 0.588235 | import os
basedir = os.path.abspath(os.path.dirname(__file__))
CSRF_ENABLED = True
SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h"
OPENID_PROVIDERS = [
{"name": "Google", "url": "https://www.google.com/accounts/o8/id"},
{"name": "Yahoo", "url": "https://me.yahoo.com"},
{"name": "AOL", "url": "http://open... | true | true |
f73635be840dcaa8541d5a931f7dd2184a0e9aca | 2,888 | py | Python | test/test_custom.py | lyon916/pyecharts | 40efd119ec7bccb4bc3d5dab985ec7aca2936911 | [
"MIT"
] | null | null | null | test/test_custom.py | lyon916/pyecharts | 40efd119ec7bccb4bc3d5dab985ec7aca2936911 | [
"MIT"
] | null | null | null | test/test_custom.py | lyon916/pyecharts | 40efd119ec7bccb4bc3d5dab985ec7aca2936911 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
from pyecharts import Bar, Line, Scatter, EffectScatter, Kline
def test_custom():
# custom_0
attr = ['A', 'B', 'C', 'D', 'E', 'F']
v1 = [10, 20, 30, 40, 50, 60]
v2 = [15, 25, 35, 45, 55, 65]
v3 = [38, 28, 58, 48, 78, 68]
bar = Bar("Line - Bar 示例")
bar.a... | 35.654321 | 79 | 0.532895 |
from pyecharts import Bar, Line, Scatter, EffectScatter, Kline
def test_custom():
attr = ['A', 'B', 'C', 'D', 'E', 'F']
v1 = [10, 20, 30, 40, 50, 60]
v2 = [15, 25, 35, 45, 55, 65]
v3 = [38, 28, 58, 48, 78, 68]
bar = Bar("Line - Bar 示例")
bar.add("bar", attr, v1)
line = Line()
line.... | true | true |
f73636427e005194ae2caceac942ddd1063e52d3 | 1,078 | py | Python | code/src/plan2scene/texture_gen/custom_ops/noise.py | madhawav/plan2scene | cc3481f503fc096d1a50ea4fbcc668b2a3b75fb5 | [
"MIT"
] | 305 | 2021-06-09T23:30:34.000Z | 2022-03-30T02:49:45.000Z | code/src/plan2scene/texture_gen/custom_ops/noise.py | madhawav/plan2scene | cc3481f503fc096d1a50ea4fbcc668b2a3b75fb5 | [
"MIT"
] | 8 | 2021-06-11T01:59:26.000Z | 2022-03-24T21:32:21.000Z | code/src/plan2scene/texture_gen/custom_ops/noise.py | madhawav/plan2scene | cc3481f503fc096d1a50ea4fbcc668b2a3b75fb5 | [
"MIT"
] | 32 | 2021-06-09T23:19:23.000Z | 2022-03-05T14:03:15.000Z | # Code adapted from https://github.com/henzler/neuraltexture/blob/master/code/custom_ops/noise/noise.py
from torch import nn
from torch.autograd import Function
import plan2scene.texture_gen.utils.neural_texture_helper as utils_nt
import noise_cuda
import torch
import numpy as np
from torch.autograd import gradcheck
... | 29.944444 | 103 | 0.730056 |
from torch import nn
from torch.autograd import Function
import plan2scene.texture_gen.utils.neural_texture_helper as utils_nt
import noise_cuda
import torch
import numpy as np
from torch.autograd import gradcheck
class NoiseFunction(Function):
@staticmethod
def forward(ctx, position, seed):
ctx.save... | true | true |
f736365887c9571c3e54f907948e54ccd5725e4e | 6,414 | py | Python | src/rdb/models/environment.py | juliangruendner/ketos_brain_api | 6ec7e01a0996abb03dba090d832a5e1020df4180 | [
"MIT"
] | null | null | null | src/rdb/models/environment.py | juliangruendner/ketos_brain_api | 6ec7e01a0996abb03dba090d832a5e1020df4180 | [
"MIT"
] | null | null | null | src/rdb/models/environment.py | juliangruendner/ketos_brain_api | 6ec7e01a0996abb03dba090d832a5e1020df4180 | [
"MIT"
] | null | null | null | from rdb.rdb import db, LowerCaseText
from enum import Enum
import datetime
from resources.adminAccess import is_admin_user
from flask import g
import rdb.models.image as Image
from dockerUtil.dockerClient import dockerClient, wait_for_it
import config
import requests
import uuid
from flask_restful import abort
import ... | 30.112676 | 128 | 0.63985 | from rdb.rdb import db, LowerCaseText
from enum import Enum
import datetime
from resources.adminAccess import is_admin_user
from flask import g
import rdb.models.image as Image
from dockerUtil.dockerClient import dockerClient, wait_for_it
import config
import requests
import uuid
from flask_restful import abort
import ... | true | true |
f736369cbe9d074b967f6f6e71550893a185fd79 | 4,636 | py | Python | src/ball_window.py | gltchitm/desktop-pong | aff92e8fc683d72e6139b33b56736dc2fe9c3ca0 | [
"MIT"
] | null | null | null | src/ball_window.py | gltchitm/desktop-pong | aff92e8fc683d72e6139b33b56736dc2fe9c3ca0 | [
"MIT"
] | null | null | null | src/ball_window.py | gltchitm/desktop-pong | aff92e8fc683d72e6139b33b56736dc2fe9c3ca0 | [
"MIT"
] | null | null | null | from gi.repository import Gtk, Gdk
import cairo
from random import getrandbits
from ball_drawing_area import BallDrawingArea
from store import store
from near import near
import config
def rand_velocity():
return config.BALL_VELOCITY if getrandbits(1) else -config.BALL_VELOCITY
class BallWindow(Gtk.Window):
... | 34.597015 | 110 | 0.622951 | from gi.repository import Gtk, Gdk
import cairo
from random import getrandbits
from ball_drawing_area import BallDrawingArea
from store import store
from near import near
import config
def rand_velocity():
return config.BALL_VELOCITY if getrandbits(1) else -config.BALL_VELOCITY
class BallWindow(Gtk.Window):
... | true | true |
f73637169849c878d792f9992621b4bc541554d0 | 1,918 | py | Python | task/collect_thirdparty_licenses.py | yshrk1597/nimclosedenv | 2fc92e4e3b03e9f9aed92642af742ac4d4ffb1e6 | [
"MIT"
] | null | null | null | task/collect_thirdparty_licenses.py | yshrk1597/nimclosedenv | 2fc92e4e3b03e9f9aed92642af742ac4d4ffb1e6 | [
"MIT"
] | null | null | null | task/collect_thirdparty_licenses.py | yshrk1597/nimclosedenv | 2fc92e4e3b03e9f9aed92642af742ac4d4ffb1e6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import os
import pathlib
import json
import urllib.parse
import requests
'''
json format
[
{
"name": "",
"url": "",
"category":"",
"filename-format":""
},
]
'''
def download(session, url, filename):
print(f"get {url}")
r = session.get(url)
if r.status_code =... | 29.507692 | 94 | 0.487487 |
import sys
import os
import pathlib
import json
import urllib.parse
import requests
def download(session, url, filename):
print(f"get {url}")
r = session.get(url)
if r.status_code == requests.codes.ok:
print(f"save {filename}")
data = r.text
with open(filename, "w", encoding='ut... | true | true |
f7363798e2b7842fd9105ce3f50bac3499622d10 | 4,632 | py | Python | fortnox/services/cost_center_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 21 | 2020-03-21T14:49:33.000Z | 2022-02-02T12:46:08.000Z | fortnox/services/cost_center_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 5 | 2020-07-03T18:55:48.000Z | 2021-11-02T10:25:32.000Z | fortnox/services/cost_center_services.py | xalien10/fortnox-python | 7c5fe29a8adaa5a21288df4495996e20515ba8a7 | [
"MIT"
] | 3 | 2020-06-08T06:23:50.000Z | 2021-06-10T18:28:32.000Z | class CostCenterService(object):
"""
:class:`fortnox.CostCenterService` is used by :class:`fortnox.Client` to make
actions related to CostCenter resource.
Normally you won't instantiate this class directly.
"""
"""
Allowed attributes for CostCenter to send to Fortnox backend servers.
"... | 38.280992 | 152 | 0.656952 | class CostCenterService(object):
OPTS_KEYS_TO_PERSIST = ['Code', 'Description']
SERVICE = "CostCenter"
def __init__(self, http_client):
self.__http_client = http_client
@property
def http_client(self):
return self.__http_client
def list(self, **params):
_, _, cost_c... | true | true |
f736383903fae4d8d7d3cbcadabd5161e1f75a1b | 5,125 | py | Python | src/foolysh/fsm.py | tcdude/foolysh | dedd6eb655b9eab1d1ac90c6624b0ca92f54486f | [
"MIT"
] | 2 | 2019-05-04T01:22:55.000Z | 2019-10-04T10:48:05.000Z | src/foolysh/fsm.py | tcdude/foolysh | dedd6eb655b9eab1d1ac90c6624b0ca92f54486f | [
"MIT"
] | 5 | 2020-03-09T16:15:13.000Z | 2022-01-13T02:02:27.000Z | src/foolysh/fsm.py | tcdude/foolysh | dedd6eb655b9eab1d1ac90c6624b0ca92f54486f | [
"MIT"
] | null | null | null | """
Provides the FSM class, a rudimentary implementation of a Finite State Machine.
"""
from typing import Any, Callable, Dict, List, Optional, Tuple
import sdl2
from .tools.common import to_snake_case
__author__ = 'Tiziano Bettio'
__license__ = 'MIT'
__version__ = '0.1'
__copyright__ = """Copyright (c) 2020 Tizian... | 38.246269 | 79 | 0.658537 |
from typing import Any, Callable, Dict, List, Optional, Tuple
import sdl2
from .tools.common import to_snake_case
__author__ = 'Tiziano Bettio'
__license__ = 'MIT'
__version__ = '0.1'
__copyright__ = """Copyright (c) 2020 Tiziano Bettio
Permission is hereby granted, free of charge, to any person obtaining a copy
o... | true | true |
f736392d8c764845b6ae8e78f7c882654f9d241a | 10,071 | py | Python | impactutils/transfer/ftpsender.py | cbworden/earthquake-impact-utils | fff41e41668896110bebbc7054a36dd60779655b | [
"CC0-1.0"
] | 3 | 2017-04-11T21:30:20.000Z | 2018-02-28T23:17:30.000Z | impactutils/transfer/ftpsender.py | cbworden/earthquake-impact-utils | fff41e41668896110bebbc7054a36dd60779655b | [
"CC0-1.0"
] | 103 | 2016-08-26T15:05:35.000Z | 2021-02-10T16:24:55.000Z | impactutils/transfer/ftpsender.py | cbworden/earthquake-impact-utils | fff41e41668896110bebbc7054a36dd60779655b | [
"CC0-1.0"
] | 9 | 2016-08-24T01:07:40.000Z | 2022-03-01T10:03:27.000Z | #!/usr/bin/env python
# stdlib imports
from ftplib import FTP, error_perm
import os.path
import shutil
import tempfile
# local
from .sender import Sender
class FTPSender(Sender):
'''Class for sending and deleting files and directories via FTP.
PDLSender uses a local installation of Product Distribution Lay... | 36.357401 | 125 | 0.577599 |
from ftplib import FTP, error_perm
import os.path
import shutil
import tempfile
from .sender import Sender
class FTPSender(Sender):
_required_properties = ['remote_directory', 'remote_host']
_optional_properties = ['user', 'password']
def send(self):
remote_host = self._properties['remote_host'... | true | true |
f7363ac8e3c301222fb9085a20025b96b226a9eb | 4,958 | py | Python | Chapter9/Figure9-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | 1 | 2018-08-27T10:09:06.000Z | 2018-08-27T10:09:06.000Z | Chapter9/Figure9-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | null | null | null | Chapter9/Figure9-1.py | liloganle/Reinforcement-Learning | 29ffb74a1c8e506c544245c9aff37e958e503f26 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
class RandomWalk(object):
def __init__(self, num_states=1000, groups=10, alpha=2e-5):
self.num_states = num_states # the number of states
self.groups = groups # the number... | 39.349206 | 107 | 0.594796 |
import numpy as np
from tqdm import tqdm
import matplotlib.pyplot as plt
class RandomWalk(object):
def __init__(self, num_states=1000, groups=10, alpha=2e-5):
self.num_states = num_states self.groups = groups self.alpha = alpha
s... | true | true |
f7363b31d00a4b9a3ce297b2c0f2291a97db0556 | 3,344 | py | Python | var/spack/repos/builtin/packages/spdlog/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/spdlog/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/spdlog/package.py | MiddelkoopT/spack | 4d94c4c4600f42a7a3bb3d06ec879140bc259304 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2022-01-18T23:39:24.000Z | 2022-01-18T23:39:24.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Spdlog(CMakePackage):
"""Very fast, header only, C++ logging library"""
homepage = "h... | 54.819672 | 96 | 0.747309 |
from spack import *
class Spdlog(CMakePackage):
homepage = "https://github.com/gabime/spdlog"
url = "https://github.com/gabime/spdlog/archive/v0.9.0.tar.gz"
version('1.8.1', sha256='5197b3147cfcfaa67dd564db7b878e4a4b3d9f3443801722b3915cdeced656cb')
version('1.8.0', sha256='1e68e9b40cf63bb022a4b18cd... | true | true |
f7363c67ecf0557ee81b88769cad34b8eafd3728 | 682 | py | Python | Python Advanced/Advanced/Tuples and Sets/Exercise/Task06.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | 1 | 2022-03-16T10:23:04.000Z | 2022-03-16T10:23:04.000Z | Python Advanced/Advanced/Tuples and Sets/Exercise/Task06.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | Python Advanced/Advanced/Tuples and Sets/Exercise/Task06.py | IvanTodorovBG/SoftUni | 7b667f6905d9f695ab1484efbb02b6715f6d569e | [
"MIT"
] | null | null | null | n = int(input())
even_set = set()
odd_set = set()
for index in range(1, n + 1):
name = input()
ascii_value = 0
for char in name:
ascii_value += ord(char)
ascii_value /= index
ascii_value = int(ascii_value)
if ascii_value % 2 == 0:
even_set.add(ascii_value)
else:
... | 22.733333 | 52 | 0.61437 | n = int(input())
even_set = set()
odd_set = set()
for index in range(1, n + 1):
name = input()
ascii_value = 0
for char in name:
ascii_value += ord(char)
ascii_value /= index
ascii_value = int(ascii_value)
if ascii_value % 2 == 0:
even_set.add(ascii_value)
else:
... | true | true |
f7363e2b72f9b4c0f235a44590c692b9349869a4 | 1,532 | py | Python | server/canonicalization/utils/log.py | hotpxl/canonicalization-server | ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | [
"MIT"
] | 3 | 2015-10-29T21:43:27.000Z | 2020-05-26T09:17:41.000Z | server/canonicalization/utils/log.py | hotpxl/canonicalization-server | ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | [
"MIT"
] | null | null | null | server/canonicalization/utils/log.py | hotpxl/canonicalization-server | ac3c0e93adf35015d7f6cfc8c6cf2e6ec45cdeae | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import logging
class _Formatter(logging.Formatter):
def __init__(self):
datefmt = '%m%d %H:%M:%S'
super(_Formatter, self).__init__(datefmt=datefmt)
def get_color(self, level):
if logging.WARNING <= level:
... | 27.357143 | 79 | 0.580287 | from __future__ import absolute_import
from __future__ import print_function
import logging
class _Formatter(logging.Formatter):
def __init__(self):
datefmt = '%m%d %H:%M:%S'
super(_Formatter, self).__init__(datefmt=datefmt)
def get_color(self, level):
if logging.WARNING <= level:
... | true | true |
f7363ff34bb5175c2483c71a8f1bc69582de84b2 | 3,302 | py | Python | techreview/settings.py | lcared/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | 1 | 2021-06-14T17:39:37.000Z | 2021-06-14T17:39:37.000Z | techreview/settings.py | mjelde/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | null | null | null | techreview/settings.py | mjelde/TechReview2021 | 96b5f9af3c35f2f1dc79e6c53b48623d84e21da8 | [
"MIT"
] | null | null | null | """
Django settings for techreview project.
Generated by 'django-admin startproject' using Django 3.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from path... | 25.796875 | 91 | 0.692611 |
from pathlib import Path
from decouple import config
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'dj... | true | true |
f73640ecbf844dab79db03ff22b848317b94f45e | 3,023 | py | Python | sphinx/source/tutorial/solutions/les_mis.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | 2 | 2021-09-01T12:36:06.000Z | 2021-11-17T10:48:36.000Z | sphinx/source/tutorial/solutions/les_mis.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | null | null | null | sphinx/source/tutorial/solutions/les_mis.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | 1 | 2016-03-18T03:01:59.000Z | 2016-03-18T03:01:59.000Z | import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
# EXERCISE: try out different sort orders for the names
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['... | 32.505376 | 84 | 0.670526 | import numpy as np
from bokeh.plotting import figure, output_file, show
from bokeh.models import HoverTool, ColumnDataSource
from bokeh.sampledata.les_mis import data
nodes = data['nodes']
names = [node['name'] for node in sorted(data['nodes'], key=lambda x: x['group'])]
N = len(nodes)
counts = np.empty((N, N))
for ... | true | true |
f73641597666934bb64b5e3940ed3742742977cd | 3,013 | py | Python | Scribe/other_estimators.py | aristoteleo/scribe-py | ea28d2b588f8648b9ce1679fe18c3142aee2aa58 | [
"BSD-3-Clause"
] | 32 | 2019-08-15T20:58:30.000Z | 2022-03-17T14:16:31.000Z | Scribe/other_estimators.py | aristoteleo/scribe-py | ea28d2b588f8648b9ce1679fe18c3142aee2aa58 | [
"BSD-3-Clause"
] | 6 | 2020-03-06T06:02:08.000Z | 2022-03-30T22:37:59.000Z | Scribe/other_estimators.py | aristoteleo/scribe-py | ea28d2b588f8648b9ce1679fe18c3142aee2aa58 | [
"BSD-3-Clause"
] | 10 | 2020-03-05T09:56:04.000Z | 2021-03-14T12:16:54.000Z | import pandas
import numpy as np
from multiprocessing import Pool
def __individual_corr(id1, id2, x, y):
return (id1, id2, corr(x, y)[0])
def __individual_mi(id1, id2, x, y):
return (id1, id2, mi(x, y))
def corr(self, number_of_processes=1):
"""Calculate pairwise correlation over the data
Argumen... | 35.869048 | 185 | 0.654165 | import pandas
import numpy as np
from multiprocessing import Pool
def __individual_corr(id1, id2, x, y):
return (id1, id2, corr(x, y)[0])
def __individual_mi(id1, id2, x, y):
return (id1, id2, mi(x, y))
def corr(self, number_of_processes=1):
self.corr_results = pandas.DataFrame({node_id: [np.nan for i... | true | true |
f73642dae27409c6118a87490a8475aae4fb34f2 | 5,536 | py | Python | liteflow/input.py | frankilepro/LiTeFlow | d07105ea00ad29b701e1b100d9cda2297eef19de | [
"Apache-2.0"
] | null | null | null | liteflow/input.py | frankilepro/LiTeFlow | d07105ea00ad29b701e1b100d9cda2297eef19de | [
"Apache-2.0"
] | null | null | null | liteflow/input.py | frankilepro/LiTeFlow | d07105ea00ad29b701e1b100d9cda2297eef19de | [
"Apache-2.0"
] | null | null | null | """Utilities for input pipelines."""
import tensorflow as tf
def shuffle(tensors,
capacity=32,
min_after_dequeue=16,
num_threads=1,
dtypes=None,
shapes=None,
seed=None,
shared_name=None,
name='shuffle'):
"""Wrapper ar... | 40.705882 | 83 | 0.627168 |
import tensorflow as tf
def shuffle(tensors,
capacity=32,
min_after_dequeue=16,
num_threads=1,
dtypes=None,
shapes=None,
seed=None,
shared_name=None,
name='shuffle'):
tensors = list(tensors)
with tf.name_scope(na... | true | true |
f73642fd4c1a40e9dd300d78c5863ed4603901d6 | 12,577 | py | Python | tsfresh/feature_selection/relevance.py | Nickwangpeng/tsfresh | 48118627d9d4644906613e25b077ce2ec82ca2f9 | [
"MIT"
] | 1 | 2020-03-25T22:08:04.000Z | 2020-03-25T22:08:04.000Z | tsfresh/feature_selection/relevance.py | Chao-Jiang/tsfresh | 48118627d9d4644906613e25b077ce2ec82ca2f9 | [
"MIT"
] | null | null | null | tsfresh/feature_selection/relevance.py | Chao-Jiang/tsfresh | 48118627d9d4644906613e25b077ce2ec82ca2f9 | [
"MIT"
] | 1 | 2019-12-30T14:07:12.000Z | 2019-12-30T14:07:12.000Z | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
"""
Contains a feature selection method that evaluates the importance of the different extracted features. To do so,
for ev... | 45.078853 | 120 | 0.678699 |
from multiprocessing import Pool
import warnings
import numpy as np
import pandas as pd
from functools import partial, reduce
from tsfresh import defaults
from tsfresh.feature_selection.benjamini_hochberg_test import benjamini_hochberg_test
from tsfresh.feature_selection.significance_tests import target_binary_featu... | true | true |
f7364342837e8e9664cc1bea548231dfc7f87e39 | 5,173 | py | Python | welib/FEM/reduction.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 24 | 2019-07-24T23:37:10.000Z | 2022-03-30T20:40:40.000Z | welib/FEM/reduction.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | null | null | null | welib/FEM/reduction.py | moonieann/welib | 0e430ad3ca034d0d2d60bdb7bbe06c947ce08f52 | [
"MIT"
] | 11 | 2019-03-14T13:47:04.000Z | 2022-03-31T15:47:27.000Z | import numpy as np
from welib.system.eva import eig
def CraigBampton(MM, KK, Ileader, nModesCB=None, Ifollow=None, F=None, DD=None, fullModesOut=False):
"""
Performs the CraigBampton (CB) reduction of a system given some input master dofs index
and a number of modes. Reduced matrices, and Guyan and Crai... | 34.486667 | 167 | 0.594626 | import numpy as np
from welib.system.eva import eig
def CraigBampton(MM, KK, Ileader, nModesCB=None, Ifollow=None, F=None, DD=None, fullModesOut=False):
Ileader = np.asarray(Ileader).ravel()
if Ifollow is None:
Iall = np.arange(len(MM))
Ifollow = [i for i in Iall if i... | true | true |
f7364375968b371ac7c5110a2aae3ab9342ca3bb | 2,884 | py | Python | .venv/lib/python3.8/site-packages/pycrop/tools.py | amon-wanyonyi/publication | caae5e04f9191493408145ac80dc943dba7e93ca | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/pycrop/tools.py | amon-wanyonyi/publication | caae5e04f9191493408145ac80dc943dba7e93ca | [
"MIT"
] | null | null | null | .venv/lib/python3.8/site-packages/pycrop/tools.py | amon-wanyonyi/publication | caae5e04f9191493408145ac80dc943dba7e93ca | [
"MIT"
] | null | null | null | import os
import re
from math import floor
from PIL import Image
def default_save_path(path, size):
savepath, ext = os.path.splitext(path)
savepath = '%s__w%dh%d%s' % (savepath, *size, ext)
return savepath
def assure_path_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def no... | 25.298246 | 69 | 0.601942 | import os
import re
from math import floor
from PIL import Image
def default_save_path(path, size):
savepath, ext = os.path.splitext(path)
savepath = '%s__w%dh%d%s' % (savepath, *size, ext)
return savepath
def assure_path_exists(path):
if not os.path.exists(path):
os.makedirs(path)
def no... | true | true |
f73644650dd1855dd44249090e286bf11f7c6b16 | 11,199 | py | Python | mlbench_core/optim/pytorch/fp_optimizers.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | mlbench_core/optim/pytorch/fp_optimizers.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | mlbench_core/optim/pytorch/fp_optimizers.py | c4dt/mlbench-core | 8a5cf6e00ff4535b2aea23b213241858a5ee5f00 | [
"Apache-2.0"
] | null | null | null | # import ctypes
import logging
import math
import torch
import torch.distributed as dist
from torch.nn.utils import clip_grad_norm_
from mlbench_core.utils.pytorch.distributed import (
AllReduceAggregation,
AllReduceAggregationHVD,
)
try:
from apex.optimizers import FusedAdam
from apex import amp
exc... | 32.273775 | 150 | 0.628003 | import logging
import math
import torch
import torch.distributed as dist
from torch.nn.utils import clip_grad_norm_
from mlbench_core.utils.pytorch.distributed import (
AllReduceAggregation,
AllReduceAggregationHVD,
)
try:
from apex.optimizers import FusedAdam
from apex import amp
except ImportError ... | true | true |
f736477bb6aa66636e35c7f32ac0a2e1313242fa | 8,375 | py | Python | secmmf/mmf_data_loader/form_parsers.py | yj1990/sec_mmf | 72a8c0d5a6aadb4362c07a5606c70e51b08a53cd | [
"MIT"
] | 1 | 2019-12-20T17:52:14.000Z | 2019-12-20T17:52:14.000Z | secmmf/mmf_data_loader/form_parsers.py | yj1990/sec_mmf | 72a8c0d5a6aadb4362c07a5606c70e51b08a53cd | [
"MIT"
] | null | null | null | secmmf/mmf_data_loader/form_parsers.py | yj1990/sec_mmf | 72a8c0d5a6aadb4362c07a5606c70e51b08a53cd | [
"MIT"
] | null | null | null | import pandas as pd
import bs4 as bs
import untangle as ut
import requests
import urllib.request as rq
from collections import OrderedDict
from secmmf.mmf_data_loader.utils import get_edgar_url
class N_MFP2:
def __init__(self):
self.select_cols()
def born(self, tag):
# if tag is a single-nod... | 43.848168 | 109 | 0.488597 | import pandas as pd
import bs4 as bs
import untangle as ut
import requests
import urllib.request as rq
from collections import OrderedDict
from secmmf.mmf_data_loader.utils import get_edgar_url
class N_MFP2:
def __init__(self):
self.select_cols()
def born(self, tag):
childs =... | true | true |
f73647b2a6012065708253b687595d2d32a619e0 | 6,002 | bzl | Python | go/private/actions/archive.bzl | tomlu/rules_go | 28dd92b09c978ad09c74c18161a1da844235adfb | [
"Apache-2.0"
] | 1 | 2020-12-02T20:04:26.000Z | 2020-12-02T20:04:26.000Z | go/private/actions/archive.bzl | tomlu/rules_go | 28dd92b09c978ad09c74c18161a1da844235adfb | [
"Apache-2.0"
] | null | null | null | go/private/actions/archive.bzl | tomlu/rules_go | 28dd92b09c978ad09c74c18161a1da844235adfb | [
"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... | 36.375758 | 139 | 0.619294 |
load(
"@io_bazel_rules_go//go/private:common.bzl",
"as_tuple",
"split_srcs",
)
load(
"@io_bazel_rules_go//go/private:mode.bzl",
"LINKMODE_C_ARCHIVE",
"LINKMODE_C_SHARED",
"mode_string",
)
load(
"@io_bazel_rules_go//go/private:providers.bzl",
"GoArchive",
"GoArchiveData",
"ef... | true | true |
f73647b504c490e3c41803e6e2a4d597213a1d43 | 1,900 | py | Python | gsadjust/data/__init__.py | jkennedy-usgs/sgp-gsadjust | 929d650674b942d33168bcdaae7da07db175a1c4 | [
"CC0-1.0"
] | 5 | 2019-01-08T13:51:23.000Z | 2020-04-22T19:04:20.000Z | gsadjust/data/__init__.py | jkennedy-usgs/sgp-gsadjust | 929d650674b942d33168bcdaae7da07db175a1c4 | [
"CC0-1.0"
] | 113 | 2018-06-14T21:39:59.000Z | 2022-01-21T19:34:12.000Z | gsadjust/data/__init__.py | jkennedy-usgs/sgp-gsadjust | 929d650674b942d33168bcdaae7da07db175a1c4 | [
"CC0-1.0"
] | 3 | 2021-01-26T07:10:42.000Z | 2022-03-15T12:39:35.000Z | """
data
====
GSadjust objects for non-Survey | Loop | Station objects (those are
represented as PyQt objects).
--------------------------------------------------------------------------------
The main data objects are:
ChannelList: Holds lists of observed data values (g, tilt, temp, etc.). The
lists are ... | 35.849057 | 81 | 0.728421 | from . import adjustment, analysis, channel, correction, datum, delta, tare
from .adjustment import (
AdjustedStation,
Adjustment,
AdjustmentOptions,
AdjustmentResults,
)
from .channel import ChannelList
from .datum import Datum
from .delta import (
Delta3Point,
DeltaList,
DeltaN... | true | true |
f73647cb9744604fcafbadc9ef4a6ae28b197403 | 937 | py | Python | named_entity_recognition1.py | DreamFireworks/nlp | e96e6f505964f1886e3de5347f2c1179cf2578e5 | [
"MIT"
] | null | null | null | named_entity_recognition1.py | DreamFireworks/nlp | e96e6f505964f1886e3de5347f2c1179cf2578e5 | [
"MIT"
] | null | null | null | named_entity_recognition1.py | DreamFireworks/nlp | e96e6f505964f1886e3de5347f2c1179cf2578e5 | [
"MIT"
] | null | null | null | import nltk
text="""A biography of Yue Fei, the Eguo Jintuo Zubian (鄂國金佗稡编), was written 60 years after his death by his grandson, the poet and historian Yue Ke (岳柯) (1183–post 1240).[3][4][5] In 1346 it was incorporated into the History of Song, a 496-chapter record of historical events and biographies of noted Song ... | 72.076923 | 621 | 0.770544 | import nltk
text="""A biography of Yue Fei, the Eguo Jintuo Zubian (鄂國金佗稡编), was written 60 years after his death by his grandson, the poet and historian Yue Ke (岳柯) (1183–post 1240).[3][4][5] In 1346 it was incorporated into the History of Song, a 496-chapter record of historical events and biographies of noted Song ... | true | true |
f736498c71b92611343f1c80a567282dd6f753c1 | 413 | py | Python | eHealth_Version1.0_01_13_2022_12_47_pm_Release/BUS/BUS_XRayPatient.py | kyvipro113/Graduation_Thesis | 71e9e3aa2adf64cff7319d056592f8b6ef1fd5ec | [
"MIT"
] | null | null | null | eHealth_Version1.0_01_13_2022_12_47_pm_Release/BUS/BUS_XRayPatient.py | kyvipro113/Graduation_Thesis | 71e9e3aa2adf64cff7319d056592f8b6ef1fd5ec | [
"MIT"
] | null | null | null | eHealth_Version1.0_01_13_2022_12_47_pm_Release/BUS/BUS_XRayPatient.py | kyvipro113/Graduation_Thesis | 71e9e3aa2adf64cff7319d056592f8b6ef1fd5ec | [
"MIT"
] | null | null | null | from DAL.DAL_XRayPatient import DAL_XRayPatient
class BUS_XRayPatient():
def __init__(self):
self.dalXRayPatient = DAL_XRayPatient()
def firstLoadLinkXRay(self, IDPatient):
return self.dalXRayPatient.selectLinkXRayViaIDPatient(IDPatient=IDPatient)
def loadLinkXRay(self, IDPatient, XRayTyp... | 37.545455 | 89 | 0.774818 | from DAL.DAL_XRayPatient import DAL_XRayPatient
class BUS_XRayPatient():
def __init__(self):
self.dalXRayPatient = DAL_XRayPatient()
def firstLoadLinkXRay(self, IDPatient):
return self.dalXRayPatient.selectLinkXRayViaIDPatient(IDPatient=IDPatient)
def loadLinkXRay(self, IDPatient, XRayTyp... | true | true |
f7364b16fc4142c59fd6ce8321417e4f024bf8de | 1,543 | py | Python | internal/notes/builtin-SAVE/packages/r-rodbc/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/r-rodbc/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/r-rodbc/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 41.702703 | 78 | 0.672715 | from spack import *
class RRodbc(RPackage):
homepage = "https://cran.rstudio.com/web/packages/RODBC/"
url = "https://cran.rstudio.com/src/contrib/RODBC_1.3-13.tar.gz"
version('1.3-13', 'c52ef9139c2ed85adc53ad6effa7d68e')
depends_on('unixodbc')
| true | true |
f7364bb8d7801da82a198367f1f1d7ca19fe8f6b | 373 | py | Python | wordcloud/__init__.py | jcfr/word_cloud | d01847f973b45af9198c36b922a908b4374afe4d | [
"MIT"
] | null | null | null | wordcloud/__init__.py | jcfr/word_cloud | d01847f973b45af9198c36b922a908b4374afe4d | [
"MIT"
] | null | null | null | wordcloud/__init__.py | jcfr/word_cloud | d01847f973b45af9198c36b922a908b4374afe4d | [
"MIT"
] | null | null | null | from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
get_single_color_func)
from .color_from_image import ImageColorGenerator
__all__ = ['WordCloud', 'STOPWORDS', 'random_color_func',
'get_single_color_func', 'ImageColorGenerator']
from ._version import get_versions
__ve... | 33.909091 | 64 | 0.742627 | from .wordcloud import (WordCloud, STOPWORDS, random_color_func,
get_single_color_func)
from .color_from_image import ImageColorGenerator
__all__ = ['WordCloud', 'STOPWORDS', 'random_color_func',
'get_single_color_func', 'ImageColorGenerator']
from ._version import get_versions
__ve... | true | true |
f7364c56f83403121dd05f261447211892d91a9e | 542 | py | Python | I_love_Easin.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | I_love_Easin.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | I_love_Easin.py | mdhasan8/Problem_Solving | ac18f30ecc7d1baa4cea382c53aec16a544530be | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Aug 28 12:20:40 2021
@author: Easin
"""
in1 = input()
in1 = int(in1)
in2 = input().split()
list1 = []
for elem in range(len(in2)):
list1.append(int(in2[elem]))
#print(list1)
amazing = 0
min1 = list1[0]
max1 = list1[0]
for val in range(len(lis... | 16.424242 | 36 | 0.498155 |
in1 = input()
in1 = int(in1)
in2 = input().split()
list1 = []
for elem in range(len(in2)):
list1.append(int(in2[elem]))
amazing = 0
min1 = list1[0]
max1 = list1[0]
for val in range(len(list1)-1):
if list1[val +1] > min1:
amazing +=1
min1 = list1[val+1]
el... | true | true |
f7364d5dfda7356574ef3f753491f24da0998c62 | 854 | py | Python | triple_agent/reports/generation/generate_external_reports.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | 3 | 2020-04-25T11:42:03.000Z | 2020-07-08T16:38:26.000Z | triple_agent/reports/generation/generate_external_reports.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | 17 | 2019-08-11T19:09:55.000Z | 2021-03-30T17:12:28.000Z | triple_agent/reports/generation/generate_external_reports.py | andrewzwicky/TripleAgent | 8d056df5c53a3d264dc778bad6771a0a2f62e7e7 | [
"MIT"
] | null | null | null | import json
from enum import Enum
from triple_agent.reports.generation.generic_query import populate_data_properties
def generate_external_reports(
games, data_query_properties, json_file_path, html_file_path
):
_, data_props = populate_data_properties(games, data_query_properties)
# https://github.com/... | 35.583333 | 82 | 0.75644 | import json
from enum import Enum
from triple_agent.reports.generation.generic_query import populate_data_properties
def generate_external_reports(
games, data_query_properties, json_file_path, html_file_path
):
_, data_props = populate_data_properties(games, data_query_properties)
if isinstance... | true | true |
f7364d9908dc590a28f74d0749e5123f5854f229 | 160,627 | py | Python | IsoFit.py | wjwainwright/Capstone | a2ea661079ece6ff5008f4399b3f0f6d32c598d3 | [
"MIT"
] | null | null | null | IsoFit.py | wjwainwright/Capstone | a2ea661079ece6ff5008f4399b3f0f6d32c598d3 | [
"MIT"
] | null | null | null | IsoFit.py | wjwainwright/Capstone | a2ea661079ece6ff5008f4399b3f0f6d32c598d3 | [
"MIT"
] | null | null | null | try:
runCount += 1
except:
isoIn = False
clIn = False
cataIn = False
closePlots = False
resultsIn = False
clusterList = []
clusters=[]
isochrones = []
isoList = []
catalogue = []
runCount = 1
class resultClusterObj:
def __init__(self,cl):
import numpy as np
... | 37.599953 | 457 | 0.588674 | try:
runCount += 1
except:
isoIn = False
clIn = False
cataIn = False
closePlots = False
resultsIn = False
clusterList = []
clusters=[]
isochrones = []
isoList = []
catalogue = []
runCount = 1
class resultClusterObj:
def __init__(self,cl):
import numpy as np
... | true | true |
f7364db0a9b0f7a13ada988a208e0f0859847424 | 2,476 | py | Python | neurolib/utils/saver.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 258 | 2020-01-26T14:38:09.000Z | 2022-03-31T14:54:04.000Z | neurolib/utils/saver.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 172 | 2020-01-27T11:02:28.000Z | 2022-03-22T22:25:38.000Z | neurolib/utils/saver.py | Ronjaa95/neurolib | 6d066a6428718ec85c9b1b87707ea73bc179ebf9 | [
"MIT"
] | 49 | 2020-02-04T08:34:44.000Z | 2022-03-28T09:29:12.000Z | """
Saving model output.
"""
import json
import pickle
from copy import deepcopy
import os
import numpy as np
import xarray as xr
def save_to_pickle(datafield, filename):
"""
Save datafield to pickle file. Keep in mind that restoring a pickle
requires that the internal structure of the types for the pi... | 29.47619 | 117 | 0.640549 |
import json
import pickle
from copy import deepcopy
import os
import numpy as np
import xarray as xr
def save_to_pickle(datafield, filename):
assert isinstance(datafield, (xr.DataArray, xr.Dataset))
if not filename.endswith(".pkl"):
filename += ".pkl"
with open(filename, "wb") as handle:
... | true | true |
f7364ddf2333b397212e2ec8913c3f5019780df6 | 163 | py | Python | vizdoomgym/envs/vizdoomtakecover.py | AlexGonRo/vizdoomgym | 231b5f07d878f4e8cab49e09db5cbc38c2d3abfb | [
"MIT"
] | 1 | 2021-04-13T19:05:27.000Z | 2021-04-13T19:05:27.000Z | vizdoomgym/envs/vizdoomtakecover.py | safijari/vizdoomgym | 4ba08296d528a40ce865f30f7abfef93417614f4 | [
"MIT"
] | 12 | 2019-10-21T04:53:12.000Z | 2022-02-10T00:28:37.000Z | vizdoomgym/envs/vizdoomtakecover.py | safijari/vizdoomgym | 4ba08296d528a40ce865f30f7abfef93417614f4 | [
"MIT"
] | 1 | 2021-12-14T12:20:39.000Z | 2021-12-14T12:20:39.000Z | from vizdoomgym.envs.vizdoomenv import VizdoomEnv
class VizdoomTakeCover(VizdoomEnv):
def __init__(self):
super(VizdoomTakeCover, self).__init__(7)
| 20.375 | 49 | 0.760736 | from vizdoomgym.envs.vizdoomenv import VizdoomEnv
class VizdoomTakeCover(VizdoomEnv):
def __init__(self):
super(VizdoomTakeCover, self).__init__(7)
| true | true |
f7364f6d6829dd6dc289c75df401165fac819425 | 2,399 | py | Python | tests/test_tensor_transform.py | aripekka/tbcalc | a0337db245f5391bfa9a42123994832c299b1fbe | [
"MIT"
] | 1 | 2020-05-03T00:10:39.000Z | 2020-05-03T00:10:39.000Z | tests/test_tensor_transform.py | aripekka/tbcalc | a0337db245f5391bfa9a42123994832c299b1fbe | [
"MIT"
] | null | null | null | tests/test_tensor_transform.py | aripekka/tbcalc | a0337db245f5391bfa9a42123994832c299b1fbe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tests for the tensor transform functions. Run with pytest.
Created on Sat May 9 00:09:00 2020
@author: aripekka
"""
import sys
import os.path
import numpy as np
sys.path.insert(1, os.path.join(os.path.dirname(__file__),'..'))
from tbcalc.transverse_deformation import *
from tbcalc impo... | 31.155844 | 108 | 0.60025 |
import sys
import os.path
import numpy as np
sys.path.insert(1, os.path.join(os.path.dirname(__file__),'..'))
from tbcalc.transverse_deformation import *
from tbcalc import cartesian_tensors_to_cylindrical
from pyTTE import TTcrystal, Quantity
def test_isotropic_circular():
E = 165
nu = 0.22
... | true | true |
f736512234f6783eb63953d115f2c91aeee1b5bf | 23,644 | py | Python | src/trapi/trapi.py | guilhermehott/trapi | 7f44df1872b2e253bc423fa92a52efdd6d4fdbf1 | [
"MIT"
] | 1 | 2022-03-23T23:16:04.000Z | 2022-03-23T23:16:04.000Z | src/trapi/trapi.py | guilhermehott/trapi | 7f44df1872b2e253bc423fa92a52efdd6d4fdbf1 | [
"MIT"
] | null | null | null | src/trapi/trapi.py | guilhermehott/trapi | 7f44df1872b2e253bc423fa92a52efdd6d4fdbf1 | [
"MIT"
] | null | null | null | import asyncio
import base64
import hashlib
import json
import logging
import time
import urllib.parse
import uuid
import requests
import websockets
from ecdsa import NIST256p, SigningKey
from ecdsa.util import sigencode_der
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(messag... | 39.737815 | 126 | 0.611487 | import asyncio
import base64
import hashlib
import json
import logging
import time
import urllib.parse
import uuid
import requests
import websockets
from ecdsa import NIST256p, SigningKey
from ecdsa.util import sigencode_der
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s [%(levelname)s] %(messag... | true | true |
f73653a564946bc4476618628286841d18811544 | 87 | py | Python | URI/1 - INICIANTE/Python/1002 - AeraCirculo.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | 1 | 2020-04-14T16:48:16.000Z | 2020-04-14T16:48:16.000Z | URI/1 - INICIANTE/Python/1002 - AeraCirculo.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | URI/1 - INICIANTE/Python/1002 - AeraCirculo.py | william-james-pj/LogicaProgramacao | 629f746e34da2e829dc7ea2e489ac36bb1b1fb13 | [
"MIT"
] | null | null | null | raio = float(input())
n = 3.14159
area = n * pow(raio,2)
print('A={:.4f}'.format(area)) | 21.75 | 30 | 0.597701 | raio = float(input())
n = 3.14159
area = n * pow(raio,2)
print('A={:.4f}'.format(area)) | true | true |
f73653de4094f8605b644d6f1bb802bce0914670 | 2,100 | py | Python | convert_ymls.py | geofabrik/openstreetmap-carto-vectortiles | 80f8d70b17c2db4b24bfed94f128f3ef03e0ef16 | [
"CC0-1.0"
] | 50 | 2016-07-13T17:02:22.000Z | 2021-12-21T14:00:27.000Z | convert_ymls.py | geofabrik/openstreetmap-carto-vectortiles | 80f8d70b17c2db4b24bfed94f128f3ef03e0ef16 | [
"CC0-1.0"
] | 5 | 2016-12-22T14:40:57.000Z | 2018-11-10T19:44:23.000Z | convert_ymls.py | geofabrik/openstreetmap-carto-vectortiles | 80f8d70b17c2db4b24bfed94f128f3ef03e0ef16 | [
"CC0-1.0"
] | 6 | 2016-07-29T19:12:44.000Z | 2022-03-31T14:41:33.000Z | import argparse, yaml, os, os.path
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input")
parser.add_argument("-o", "--output")
parser.add_argument("--tm2", "--tm", action="store_const", const="tm2", dest="action")
parser.add_argument("--tm2source", "--tmsource", action="store_const", const="tm2source... | 36.206897 | 108 | 0.661905 | import argparse, yaml, os, os.path
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--input")
parser.add_argument("-o", "--output")
parser.add_argument("--tm2", "--tm", action="store_const", const="tm2", dest="action")
parser.add_argument("--tm2source", "--tmsource", action="store_const", const="tm2source... | true | true |
f736544ee090ae0f772d827cff827a4f55b45858 | 3,479 | py | Python | QUANTAXIS/QASetting/crontab.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 2 | 2019-05-31T02:53:12.000Z | 2020-03-09T03:21:55.000Z | QUANTAXIS/QASetting/crontab.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | null | null | null | QUANTAXIS/QASetting/crontab.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 3 | 2018-11-29T07:07:56.000Z | 2021-02-09T17:24:56.000Z | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... | 37.010638 | 80 | 0.634378 |
import md5
import time
from .external.crontab import CronTab as _CronTab
from QUANTAXIS.QASetting.cache import get_cache
DEBUG = False
class CronTabItem(_CronTab):
def __init__(self, cronschedule):
self.__schedule = cronschedule
super(CronTabItem, self).__init__(cronschedule)
@property
... | true | true |
f73654a1fc198e5bf51531dd3397e8f7e7919a6b | 957 | py | Python | stackl/helpers.py | ArtOfCode-/stackl | c66c025fa39c5fc5a6dbda7f0ea0628ee526b4b6 | [
"MIT"
] | null | null | null | stackl/helpers.py | ArtOfCode-/stackl | c66c025fa39c5fc5a6dbda7f0ea0628ee526b4b6 | [
"MIT"
] | null | null | null | stackl/helpers.py | ArtOfCode-/stackl | c66c025fa39c5fc5a6dbda7f0ea0628ee526b4b6 | [
"MIT"
] | null | null | null | class Helpers:
_cache = {}
@classmethod
def cached(cls, key, scope=None, func=None):
if scope is not None:
if scope not in cls._cache:
cls._cache[scope] = {}
if key in cls._cache[scope]:
return cls._cache[scope][key]
else:
... | 28.147059 | 57 | 0.487983 | class Helpers:
_cache = {}
@classmethod
def cached(cls, key, scope=None, func=None):
if scope is not None:
if scope not in cls._cache:
cls._cache[scope] = {}
if key in cls._cache[scope]:
return cls._cache[scope][key]
else:
... | true | true |
f736559162d2fb353e82402c79261dc665f58d3e | 425 | py | Python | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-09T09:51:13.000Z | 2021-06-09T09:51:13.000Z | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | null | null | null | pytorch_forecasting/__init__.py | KazukiNoto/pytorch-forecasting | 8a1636388e091456f042f999892dd52733903dd6 | [
"MIT"
] | 1 | 2021-06-15T11:31:44.000Z | 2021-06-15T11:31:44.000Z | """
PyTorch Forecasting package for timeseries forecasting with PyTorch.
"""
from pytorch_forecasting.data import EncoderNormalizer, GroupNormalizer, TimeSeriesDataSet
from pytorch_forecasting.models import Baseline, NBeats, TemporalFusionTransformer
__all__ = [
"TimeSeriesDataSet",
"GroupNormalizer",
"Enc... | 25 | 90 | 0.764706 | from pytorch_forecasting.data import EncoderNormalizer, GroupNormalizer, TimeSeriesDataSet
from pytorch_forecasting.models import Baseline, NBeats, TemporalFusionTransformer
__all__ = [
"TimeSeriesDataSet",
"GroupNormalizer",
"EncoderNormalizer",
"TemporalFusionTransformer",
"NBeats",
"Baseline... | true | true |
f73655e939118e53abadbf7e66e1712cae7bc2c9 | 6,540 | py | Python | tensorflow_toolkit/text_recognition/text_recognition/model.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 3 | 2020-12-29T02:47:32.000Z | 2021-11-12T08:12:51.000Z | tensorflow_toolkit/text_recognition/text_recognition/model.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 28 | 2020-09-25T22:40:36.000Z | 2022-03-12T00:37:36.000Z | tensorflow_toolkit/text_recognition/text_recognition/model.py | morkovka1337/openvino_training_extensions | 846db45c264d6b061505213f51763520b9432ba9 | [
"Apache-2.0"
] | 1 | 2021-03-12T10:08:44.000Z | 2021-03-12T10:08:44.000Z | # Copyright (C) 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 49.172932 | 97 | 0.595107 |
import tensorflow as tf
from tensorflow.contrib import rnn
import tensorflow.contrib.slim as slim
class TextRecognition:
def __init__(self, is_training, num_classes, backbone_dropout=0.0):
self.is_training = is_training
self.lstm_dim = 256
self.num_classes = num_classes
self.bac... | true | true |
f7365729a08e2f23924988f567fa30354632418c | 4,823 | py | Python | docs/conf.py | michaelbilow/issho | ed0dd5487978b1753c14ce5d444d07448b13d168 | [
"MIT"
] | 1 | 2019-04-22T17:20:05.000Z | 2019-04-22T17:20:05.000Z | docs/conf.py | michaelbilow/smol | ed0dd5487978b1753c14ce5d444d07448b13d168 | [
"MIT"
] | 7 | 2019-03-28T14:26:46.000Z | 2019-05-31T03:58:26.000Z | docs/conf.py | michaelbilow/smol | ed0dd5487978b1753c14ce5d444d07448b13d168 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# issho documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 30.916667 | 81 | 0.681733 |
import os
import sys
sys.path.insert(0, os.path.abspath(".."))
import issho
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = u"issho"
copyright = u"2019, Michael Bilow"
author = u"Michael Bilow"
# for |version| an... | true | true |
f7365971d36a0732ad199a569df15896294a5c5d | 2,173 | py | Python | app.py | liyunze-coding/Trigger-Me-Elmo-2 | 6950ffa4bfd264e213626f1ab3cff249fbab36da | [
"MIT"
] | 1 | 2022-01-02T09:50:38.000Z | 2022-01-02T09:50:38.000Z | app.py | liyunze-coding/Trigger-Me-Elmo-2 | 6950ffa4bfd264e213626f1ab3cff249fbab36da | [
"MIT"
] | null | null | null | app.py | liyunze-coding/Trigger-Me-Elmo-2 | 6950ffa4bfd264e213626f1ab3cff249fbab36da | [
"MIT"
] | 1 | 2022-01-10T19:59:15.000Z | 2022-01-10T19:59:15.000Z | from flask import Flask, render_template, request, jsonify
import base64
import logging
import numpy as np
from deepface import DeepFace
from PIL import Image
from io import BytesIO
import subprocess
import os
import cv2
import random
import webbrowser
app = Flask(__name__)
log = logging.getLogger('werkzeug')
log.setL... | 25.869048 | 88 | 0.658076 | from flask import Flask, render_template, request, jsonify
import base64
import logging
import numpy as np
from deepface import DeepFace
from PIL import Image
from io import BytesIO
import subprocess
import os
import cv2
import random
import webbrowser
app = Flask(__name__)
log = logging.getLogger('werkzeug')
log.setL... | true | true |
f7365980ef0f648a9b1148fdf6a7cf556501bab6 | 15,803 | py | Python | solver.py | pyrito/SpeechSplit | ee70ee77e54d5b7cd1b39e7bef1cb96ae78f8beb | [
"MIT"
] | null | null | null | solver.py | pyrito/SpeechSplit | ee70ee77e54d5b7cd1b39e7bef1cb96ae78f8beb | [
"MIT"
] | null | null | null | solver.py | pyrito/SpeechSplit | ee70ee77e54d5b7cd1b39e7bef1cb96ae78f8beb | [
"MIT"
] | null | null | null | from torch.utils.tensorboard.summary import hparams
from model import Generator_3 as Generator
from model import InterpLnr
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
import numpy as np
import os
import time
import datetime
import pickle
from utils import pad_seq_to_2, quantize_f0_torc... | 45.41092 | 137 | 0.485351 | from torch.utils.tensorboard.summary import hparams
from model import Generator_3 as Generator
from model import InterpLnr
import matplotlib.pyplot as plt
import torch
import torch.nn.functional as F
import numpy as np
import os
import time
import datetime
import pickle
from utils import pad_seq_to_2, quantize_f0_torc... | true | true |
f7365a1da28790199225cb69fa9ccb4430d35ff0 | 1,133 | py | Python | cms/test_utils/project/placeholderapp/admin.py | foobacca/django-cms | d15586b399b18de49208bca74495a771cdbd494f | [
"BSD-3-Clause"
] | 1 | 2021-04-08T13:49:04.000Z | 2021-04-08T13:49:04.000Z | cms/test_utils/project/placeholderapp/admin.py | foobacca/django-cms | d15586b399b18de49208bca74495a771cdbd494f | [
"BSD-3-Clause"
] | 8 | 2021-06-08T23:36:57.000Z | 2022-03-12T00:49:20.000Z | cms/test_utils/project/placeholderapp/admin.py | foobacca/django-cms | d15586b399b18de49208bca74495a771cdbd494f | [
"BSD-3-Clause"
] | null | null | null | from cms.admin.placeholderadmin import PlaceholderAdmin
from cms.test_utils.project.placeholderapp.models import (Example1, MultilingualExample1, TwoPlaceholderExample)
from django.contrib import admin
from hvad.admin import TranslatableAdmin
class MixinAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_... | 32.371429 | 112 | 0.772286 | from cms.admin.placeholderadmin import PlaceholderAdmin
from cms.test_utils.project.placeholderapp.models import (Example1, MultilingualExample1, TwoPlaceholderExample)
from django.contrib import admin
from hvad.admin import TranslatableAdmin
class MixinAdmin(admin.ModelAdmin):
def formfield_for_dbfield(self, db_... | true | true |
f7365a4261bf5528b341b9ad8439969db155368a | 591 | py | Python | setup.py | Lanseuo/alasan | 198a340b74429ccab2f4095c39b245936c60ea4c | [
"MIT"
] | null | null | null | setup.py | Lanseuo/alasan | 198a340b74429ccab2f4095c39b245936c60ea4c | [
"MIT"
] | 5 | 2020-05-10T12:03:03.000Z | 2020-05-10T12:04:40.000Z | setup.py | Lanseuo/alasan | 198a340b74429ccab2f4095c39b245936c60ea4c | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="alasan",
version="0.0.1",
author="Lucas Hild",
author_email="contact@lucas-hild.de",
description="Alasan helps you build Alexa skills on AWS Lambda using Python.",
long_de... | 26.863636 | 82 | 0.680203 | from setuptools import setup, find_packages
with open("README.md", "r") as f:
long_description = f.read()
setup(
name="alasan",
version="0.0.1",
author="Lucas Hild",
author_email="contact@lucas-hild.de",
description="Alasan helps you build Alexa skills on AWS Lambda using Python.",
long_de... | true | true |
f7365b4272faa183cad3252dfec1668c82b1770d | 599 | py | Python | var/spack/repos/builtin/packages/perl-math-cdf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/perl-math-cdf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/perl-math-cdf/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PerlMathCdf(PerlPackage):
"""Generate probabilities and quantiles from several sta... | 35.235294 | 93 | 0.749583 |
from spack.package import *
class PerlMathCdf(PerlPackage):
homepage = "https://metacpan.org/pod/Math::CDF"
url = "http://search.cpan.org/CPAN/authors/id/C/CA/CALLAHAN/Math-CDF-0.1.tar.gz"
version('0.1', sha256='7896bf250835ce47dcc813cb8cf9dc576c5455de42e822dcd7d8d3fef2125565')
| true | true |
f7365b43e013e39a7186f6896627308675c2098b | 15,826 | py | Python | vyper/context/types/bases.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | 1 | 2020-07-04T01:47:26.000Z | 2020-07-04T01:47:26.000Z | vyper/context/types/bases.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | vyper/context/types/bases.py | erdnaag/vyper | 22bef3a4b4161db18c7831041e20b917984cff83 | [
"Apache-2.0"
] | null | null | null | import copy
from collections import OrderedDict
from enum import Enum
from typing import Any, Dict, Optional, Tuple, Type, Union
from vyper import ast as vy_ast
from vyper.context.types.abstract import AbstractDataType
from vyper.exceptions import (
CompilerPanic,
ImmutableViolation,
InvalidLiteral,
In... | 32.166667 | 91 | 0.625174 | import copy
from collections import OrderedDict
from enum import Enum
from typing import Any, Dict, Optional, Tuple, Type, Union
from vyper import ast as vy_ast
from vyper.context.types.abstract import AbstractDataType
from vyper.exceptions import (
CompilerPanic,
ImmutableViolation,
InvalidLiteral,
In... | true | true |
f7365b6614a2b2f2a73eeb08494f8f98110af4db | 9,560 | py | Python | mars/dataframe/datastore/tests/test_datastore_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/dataframe/datastore/tests/test_datastore_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/datastore/tests/test_datastore_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.341564 | 104 | 0.598954 |
import os
import tempfile
import unittest
import numpy as np
import pandas as pd
import mars.dataframe as md
from mars.config import option_context
from mars.dataframe import DataFrame
from mars.deploy.local.core import new_cluster
from mars.session import new_session
from mars.tests.core import TestBase, flaky
try... | true | true |
f7365c6d507efee3fdb9f656365455527ac25a4f | 5,172 | py | Python | setup.py | Eothred/pymad | f560239325452adbb1d37b6408f275ac03674069 | [
"ECL-2.0",
"Apache-2.0"
] | 3 | 2015-01-21T07:36:11.000Z | 2020-05-29T12:18:33.000Z | setup.py | Eothred/pymad | f560239325452adbb1d37b6408f275ac03674069 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2015-03-22T02:24:57.000Z | 2015-10-15T15:50:51.000Z | setup.py | Eothred/pymad | f560239325452adbb1d37b6408f275ac03674069 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-02-08T16:55:01.000Z | 2017-02-08T16:55:01.000Z | #-------------------------------------------------------------------------------
# This file is part of PyMad.
#
# Copyright (c) 2011, CERN. 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... | 35.424658 | 80 | 0.642691 |
try:
import pkg_resources
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, Extension
from distutils.util import get_platform
import sys
from os import path
PYMADVERSION=(0, 9)
try:
from Cython.Build import cythonize
except ImportError:
... | true | true |
f7365c9b7c7c285ab21ee7e4bac00b72277fcf50 | 122 | py | Python | pypro/modulos/context_processors.py | wosubtil/curso-django | 4673e71fbbec062c74dfaf866ff13b81383e3fcc | [
"MIT"
] | null | null | null | pypro/modulos/context_processors.py | wosubtil/curso-django | 4673e71fbbec062c74dfaf866ff13b81383e3fcc | [
"MIT"
] | 806 | 2020-09-18T11:26:48.000Z | 2022-03-31T00:43:46.000Z | pypro/modulos/context_processors.py | taniodev/curso-django | aa5b0edd6ca55d2ea7f73220644d5c64a96c60df | [
"MIT"
] | 1 | 2020-08-06T19:50:33.000Z | 2020-08-06T19:50:33.000Z | from pypro.modulos import facade
def listar_modulos(request):
return {'MODULOS': facade.listar_modulos_ordenados()}
| 20.333333 | 57 | 0.778689 | from pypro.modulos import facade
def listar_modulos(request):
return {'MODULOS': facade.listar_modulos_ordenados()}
| true | true |
f7365cf7cf02c8871fff6ab4ece9ab8717635813 | 7,703 | py | Python | roms/tests/joy/spadtest-nes-0.01/tools/pilbmp2nes.py | MrKOSMOS/ANESE | 8ae814d615479b1496c98033a1f5bc4da5921c6f | [
"MIT"
] | 349 | 2017-11-15T22:51:00.000Z | 2022-03-21T13:43:57.000Z | tools/pilbmp2nes.py | pubby/Ralph-4 | dcda1d3e5bce25ca22b54dfee82eb64625d64d25 | [
"CC-BY-4.0"
] | 12 | 2018-08-28T21:38:29.000Z | 2021-12-11T16:24:36.000Z | tools/pilbmp2nes.py | pubby/Ralph-4 | dcda1d3e5bce25ca22b54dfee82eb64625d64d25 | [
"CC-BY-4.0"
] | 28 | 2018-06-10T07:31:13.000Z | 2022-03-21T10:54:26.000Z | #!/usr/bin/env python
#
# Bitmap to multi-console CHR converter using PIL or Pillow
#
# Copyright 2014 Damian Yerrick
# Copying and distribution of this file, with or without
# modification, are permitted in any medium without royalty
# provided the copyright notice and this notice are preserved.
# This file is offered... | 36.164319 | 124 | 0.589251 | from __future__ import with_statement, print_function, unicode_literals
from PIL import Image
from time import sleep
import array
try:
xrange
except NameError:
xrange = range
try:
raw_input
except NameError:
raw_input = input
try:
next
except NameError:
next = lambda x: x.next()
def blank_byte_... | true | true |
f7365d1f3a6d608c0c9d0eddaeb0a2bb1cb6cb4f | 34,363 | py | Python | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 1 | 2021-09-07T18:51:21.000Z | 2021-09-07T18:51:21.000Z | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 1 | 2020-08-08T03:56:56.000Z | 2020-08-08T03:56:56.000Z | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 1 | 2022-02-16T18:23:11.000Z | 2022-02-16T18:23:11.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 51.059435 | 198 | 0.74359 | import unittest
from unittest import mock
from azure.cli.command_modules.appservice.static_sites import \
list_staticsites, show_staticsite, delete_staticsite, create_staticsites, CLIError, disconnect_staticsite, \
reconnect_staticsite, list_staticsite_environments, show_staticsite_environment, list_staticsite... | true | true |
f7365d53fe98443b87d6023ffdb580ca656c6f9e | 11,556 | py | Python | pybind/nos/v7_1_0/interface/hundredgigabitethernet/switchport/trunk/native_vlan_classification/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/switchport/trunk/native_vlan_classification/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/switchport/trunk/native_vlan_classification/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 69.614458 | 765 | 0.74325 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f7365e5d99eac8285580b730f2f811951fa7ba87 | 1,861 | py | Python | test_runner.py | tmatsuo/appengine-blobstoremigrator-python | c59c84c1a91cdab47489fc4d32ddcf35c579ba6a | [
"Apache-2.0"
] | 12 | 2015-06-10T19:48:45.000Z | 2021-04-15T06:11:01.000Z | test_runner.py | tmatsuo/appengine-blobstoremigrator-python | c59c84c1a91cdab47489fc4d32ddcf35c579ba6a | [
"Apache-2.0"
] | 1 | 2021-03-21T10:33:24.000Z | 2021-03-21T10:33:24.000Z | test_runner.py | tmatsuo/appengine-blobstoremigrator-python | c59c84c1a91cdab47489fc4d32ddcf35c579ba6a | [
"Apache-2.0"
] | 6 | 2016-07-12T02:11:43.000Z | 2021-10-03T00:54:03.000Z | #!/usr/bin/python
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 31.016667 | 78 | 0.73079 |
import os
import sys
import unittest
CUR_DIR = os.path.dirname(__file__)
SRC_DIR = os.path.join(CUR_DIR, 'src')
TEST_DIR = os.path.join(CUR_DIR, 'test')
LIB_DIR = os.path.join(SRC_DIR, 'lib')
def _fix_path():
if SRC_DIR not in sys.path:
sys.path.append(SRC_DIR)
if LIB_DIR not in sys.path:
sys.path.appen... | true | true |
f7365eb934ee15b523ebb1bbcdf7881c563276d4 | 18,861 | py | Python | stratipy/filtering_diffusion.py | candleinwindsteve/Stratipy | ea505df1e4830141c590922d654edfbde498b924 | [
"BSD-3-Clause"
] | 1 | 2021-03-08T22:52:19.000Z | 2021-03-08T22:52:19.000Z | stratipy/filtering_diffusion.py | candleinwindsteve/Stratipy | ea505df1e4830141c590922d654edfbde498b924 | [
"BSD-3-Clause"
] | null | null | null | stratipy/filtering_diffusion.py | candleinwindsteve/Stratipy | ea505df1e4830141c590922d654edfbde498b924 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import sys
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import norm
from scipy.io import loadmat, savemat
from nbs_class import Ppi, Patient
from subprocess import call
# import h5py
import os
import glob
import time
import datetime
# NOTE mutationProfileD... | 37.05501 | 118 | 0.600286 | import sys
import numpy as np
import scipy.sparse as sp
from scipy.sparse.linalg import norm
from scipy.io import loadmat, savemat
from nbs_class import Ppi, Patient
from subprocess import call
import os
import glob
import time
import datetime
def propagation(M, adj, alpha=0.7, tol=10e-6): print(' ==== propagat... | true | true |
f73661c09ab447a073f32a96f89585dfb6482f20 | 5,509 | py | Python | src/lib/utils/video.py | HLJ1997/human-action-recognition | 550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0 | [
"MIT"
] | 1 | 2021-07-14T09:15:09.000Z | 2021-07-14T09:15:09.000Z | src/lib/utils/video.py | HLJ1997/human-action-recognition | 550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0 | [
"MIT"
] | null | null | null | src/lib/utils/video.py | HLJ1997/human-action-recognition | 550fcc3d1a2d8b338535ab12cb2124cf2e9c0be0 | [
"MIT"
] | null | null | null | """
Credit to original code https://github.com/tryolabs/norfair/blob/master/norfair/video.py
modified to get output file path as user provided filename suffix and
changed constructor of Video class
"""
import os
import os.path as osp
import time
from typing import List, Optional, Union, Tuple
import cv2
import numpy ... | 36.243421 | 219 | 0.592304 |
import os
import os.path as osp
import time
from typing import List, Optional, Union, Tuple
import cv2
import numpy as np
from rich import print
from rich.progress import BarColumn, Progress, ProgressColumn, TimeRemainingColumn
def get_terminal_size(default: Tuple[int, int] = (80, 24)) -> Tuple[int, int]:
column... | true | true |
f7366281db5c2cbc331075eeeac4051f393c83a9 | 4,294 | py | Python | Self Driving Car/Python with Tensorflow/driveSDC.py | MohammadWasil/Self-Driving-Car | 9ef5b77e1268623c11e4c39d5c8e1e990caee273 | [
"MIT"
] | 7 | 2018-12-19T18:44:02.000Z | 2022-03-18T08:22:43.000Z | Self Driving Car/Python with Tensorflow/driveSDC.py | MohammadWasil/Self-Driving-Car | 9ef5b77e1268623c11e4c39d5c8e1e990caee273 | [
"MIT"
] | null | null | null | Self Driving Car/Python with Tensorflow/driveSDC.py | MohammadWasil/Self-Driving-Car | 9ef5b77e1268623c11e4c39d5c8e1e990caee273 | [
"MIT"
] | 4 | 2019-03-29T14:12:49.000Z | 2021-01-01T15:08:01.000Z | import socket
from tensorflow.keras.models import load_model
from PIL import ImageGrab
import numpy as np
import cv2
import os
#Load the model.
model = load_model(r"D:\Unity Game\Self Driving Car\SDCProgram\Best Models\data-003.h5") # Directory to load the model
# Socket Tcp Connection.
host = "12... | 30.453901 | 148 | 0.6034 | import socket
from tensorflow.keras.models import load_model
from PIL import ImageGrab
import numpy as np
import cv2
import os
model = load_model(r"D:\Unity Game\Self Driving Car\SDCProgram\Best Models\data-003.h5")
host = "127.0.0.1"
port = 25001 sock = socket.socket(socket.AF_INET, sock... | true | true |
f736631eac1f687cc72652145a76d0e53fa16fc2 | 4,127 | py | Python | fiasco/element.py | fluxtransport/fiasco | 9d70d8bdb03197be1ddfd433e1392e214a1468e8 | [
"BSD-3-Clause"
] | null | null | null | fiasco/element.py | fluxtransport/fiasco | 9d70d8bdb03197be1ddfd433e1392e214a1468e8 | [
"BSD-3-Clause"
] | null | null | null | fiasco/element.py | fluxtransport/fiasco | 9d70d8bdb03197be1ddfd433e1392e214a1468e8 | [
"BSD-3-Clause"
] | null | null | null | """
Classes and functions for element-level operations
"""
import numpy as np
import astropy.units as u
import plasmapy
import fiasco
__all__ = ['Element']
class Element(fiasco.IonCollection):
"""
Collection of all ions for a particular element.
The `Element` object provides a way to logically group to... | 33.282258 | 99 | 0.620305 | import numpy as np
import astropy.units as u
import plasmapy
import fiasco
__all__ = ['Element']
class Element(fiasco.IonCollection):
@u.quantity_input
def __init__(self, element_name, temperature: u.K, **kwargs):
if type(element_name) is str:
element_name = element_name.capitalize()
... | true | true |
f73663f3d443c0c444771b600f5712a2e9d729ec | 983 | py | Python | whoahqa/tests/models/test_reporting_period_factory.py | onaio/who-adolescent-hqa | 108a7e60b025d0723247f5f02eab2c4d41f5a02a | [
"Apache-2.0"
] | null | null | null | whoahqa/tests/models/test_reporting_period_factory.py | onaio/who-adolescent-hqa | 108a7e60b025d0723247f5f02eab2c4d41f5a02a | [
"Apache-2.0"
] | 2 | 2018-01-09T08:58:11.000Z | 2019-01-18T09:20:14.000Z | whoahqa/tests/models/test_reporting_period_factory.py | onaio/who-adolescent-hqa | 108a7e60b025d0723247f5f02eab2c4d41f5a02a | [
"Apache-2.0"
] | null | null | null | import datetime
from pyramid import testing
from whoahqa.models import (
DBSession,
ReportingPeriodFactory,
ReportingPeriod,)
from whoahqa.tests.test_base import TestBase
class TestReportingPeriodFactory(TestBase):
def test_get_item_retrieves_by_id(self):
period = ReportingPeriod(
... | 29.787879 | 64 | 0.677518 | import datetime
from pyramid import testing
from whoahqa.models import (
DBSession,
ReportingPeriodFactory,
ReportingPeriod,)
from whoahqa.tests.test_base import TestBase
class TestReportingPeriodFactory(TestBase):
def test_get_item_retrieves_by_id(self):
period = ReportingPeriod(
... | true | true |
f7366410d3402dde7686f8ca4b30c6c1c2234403 | 52,914 | py | Python | models/new/sencebgan.py | yigitozgumus/Polimi_Thesis | 711c1edcf1fdb92fc6c15bf5ab1be141c13995c3 | [
"MIT"
] | 3 | 2019-07-27T14:00:42.000Z | 2020-01-17T17:07:51.000Z | models/new/sencebgan.py | yigitozgumus/Polimi_Thesis | 711c1edcf1fdb92fc6c15bf5ab1be141c13995c3 | [
"MIT"
] | null | null | null | models/new/sencebgan.py | yigitozgumus/Polimi_Thesis | 711c1edcf1fdb92fc6c15bf5ab1be141c13995c3 | [
"MIT"
] | 4 | 2019-10-22T02:58:26.000Z | 2020-10-06T09:59:26.000Z | import tensorflow as tf
from base.base_model import BaseModel
from utils.alad_utils import get_getter
import utils.alad_utils as sn
class SENCEBGAN(BaseModel):
def __init__(self, config):
super(SENCEBGAN, self).__init__(config)
self.build_model()
self.init_saver()
def build_model(sel... | 46.785146 | 100 | 0.501191 | import tensorflow as tf
from base.base_model import BaseModel
from utils.alad_utils import get_getter
import utils.alad_utils as sn
class SENCEBGAN(BaseModel):
def __init__(self, config):
super(SENCEBGAN, self).__init__(config)
self.build_model()
self.init_saver()
def build_model(sel... | true | true |
f7366460f1bafd203830c13ee2d0e7ade440377d | 643 | py | Python | lfd/environment/settings.py | def670/lfd | 9fef15f556cba49dd4b42c0c29505a4137f95fc5 | [
"BSD-2-Clause"
] | 36 | 2015-05-22T14:47:18.000Z | 2021-07-27T15:30:36.000Z | lfd/environment/settings.py | jeffmahler/lfd | ecc6b934db098c0b1af9946454917b6dc911cb74 | [
"BSD-2-Clause"
] | null | null | null | lfd/environment/settings.py | jeffmahler/lfd | ecc6b934db098c0b1af9946454917b6dc911cb74 | [
"BSD-2-Clause"
] | 13 | 2015-05-22T15:38:07.000Z | 2021-07-28T03:20:35.000Z | #:
GRIPPER_OPEN_CLOSE_THRESH = 0.04 # .06 for fig8 (thick rope), 0.04 for thin rope (overhand)
#:
ROPE_RADIUS = .005
#:
ROPE_ANG_STIFFNESS = .1
#:
ROPE_ANG_DAMPING = 1
#:
ROPE_LIN_DAMPING = .75
#:
ROPE_ANG_LIMIT = .4
#:
ROPE_LIN_STOP_ERP = .2
#:
ROPE_MASS = 1.0
#:
ROPE_RADIUS_THICK = .008
#:... | 19.484848 | 91 | 0.623639 | GRIPPER_OPEN_CLOSE_THRESH = 0.04
ROPE_RADIUS = .005
ROPE_ANG_STIFFNESS = .1
ROPE_ANG_DAMPING = 1
ROPE_LIN_DAMPING = .75
ROPE_ANG_LIMIT = .4
ROPE_LIN_STOP_ERP = .2
ROPE_MASS = 1.0
ROPE_RADIUS_THICK = .008
WINDOW_PROP = [0,0,1500,1500]
#: transposed homogeneous matrix for the viewer's camera
C... | true | true |
f73666fc6d19b1f19d47b390ab17540bd4d53368 | 579 | py | Python | setup.py | hanhha/console_ui | 4fd3d37367bc23316620d5ad76666981762fb344 | [
"MIT"
] | 1 | 2022-02-04T03:20:31.000Z | 2022-02-04T03:20:31.000Z | setup.py | alimogh/console_ui | 4fd3d37367bc23316620d5ad76666981762fb344 | [
"MIT"
] | null | null | null | setup.py | alimogh/console_ui | 4fd3d37367bc23316620d5ad76666981762fb344 | [
"MIT"
] | 1 | 2022-02-04T03:22:03.000Z | 2022-02-04T03:22:03.000Z | #!/usr/bin/env python3
from setuptools import setup
import sys
if sys.version_info < (3,0):
sys.exit ("Python version < 3.0 is not supported")
elif sys.version_info < (3,6):
print ("Using Python version < 3.6 would cause issue relevant to the order of windows generated")
setup (name = 'console_ui',
version = '1... | 28.95 | 98 | 0.668394 |
from setuptools import setup
import sys
if sys.version_info < (3,0):
sys.exit ("Python version < 3.0 is not supported")
elif sys.version_info < (3,6):
print ("Using Python version < 3.6 would cause issue relevant to the order of windows generated")
setup (name = 'console_ui',
version = '1.0',
py_modules=['wi... | true | true |
f736674bc693ddff36470a5c55535e91fbce24e8 | 1,355 | py | Python | src/spn/experiments/AQP/leaves/static/InferenceRange.py | tkrons/SPFlow_topdownrules | 6227fc973f4f36da7fbe25fa500d656eb7273033 | [
"Apache-2.0"
] | 199 | 2018-11-13T10:37:45.000Z | 2022-02-06T17:07:28.000Z | src/spn/experiments/AQP/leaves/static/InferenceRange.py | minimrbanana/SPFlow | 32233bf29d107c62f0f727b0e64aaa74b37cfe1e | [
"Apache-2.0"
] | 46 | 2018-11-30T13:40:38.000Z | 2022-01-22T21:05:07.000Z | src/spn/experiments/AQP/leaves/static/InferenceRange.py | minimrbanana/SPFlow | 32233bf29d107c62f0f727b0e64aaa74b37cfe1e | [
"Apache-2.0"
] | 78 | 2018-11-13T10:37:48.000Z | 2022-03-14T21:34:13.000Z | """
Created on June 21, 2018
@author: Moritz
"""
import numpy as np
from spn.algorithms.Inference import add_node_likelihood
from spn.experiments.AQP.leaves.static.StaticNumeric import StaticNumeric
def static_likelihood_range(node, ranges, dtype=np.float64, **kwargs):
assert len(node.scope) == 1, node.scope
... | 25.092593 | 106 | 0.647232 |
import numpy as np
from spn.algorithms.Inference import add_node_likelihood
from spn.experiments.AQP.leaves.static.StaticNumeric import StaticNumeric
def static_likelihood_range(node, ranges, dtype=np.float64, **kwargs):
assert len(node.scope) == 1, node.scope
probs = np.ones((ranges.shape[0], 1), dtype=dt... | true | true |
f7366767fdec0eacbd4d0d9376ef997a8cdd4826 | 35,093 | py | Python | sphinx/writers/html.py | PeerHerholz/smobsc | db34d2bb96b80579bd4a3f4c198a6b524c5a134a | [
"BSD-2-Clause"
] | 3 | 2019-06-11T09:42:08.000Z | 2020-03-10T15:57:09.000Z | sphinx/writers/html.py | PeerHerholz/smobsc | db34d2bb96b80579bd4a3f4c198a6b524c5a134a | [
"BSD-2-Clause"
] | 12 | 2019-01-09T15:43:57.000Z | 2020-01-21T10:46:30.000Z | sphinx/writers/html.py | PeerHerholz/smobsc | db34d2bb96b80579bd4a3f4c198a6b524c5a134a | [
"BSD-2-Clause"
] | 10 | 2019-02-04T11:49:35.000Z | 2020-03-21T13:32:20.000Z | """
sphinx.writers.html
~~~~~~~~~~~~~~~~~~~
docutils writers handling Sphinx' custom nodes.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import copy
import os
import posixpath
import sys
import warnings
from typing import Iterable, c... | 37.41258 | 105 | 0.58402 |
import copy
import os
import posixpath
import sys
import warnings
from typing import Iterable, cast
from docutils import nodes
from docutils.writers.html4css1 import Writer, HTMLTranslator as BaseTranslator
from sphinx import addnodes
from sphinx.builders import Builder
from sphinx.deprecation import RemovedInSphinx... | true | true |
f7366798202eb5b63a293458869820181b482fe2 | 10,620 | py | Python | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 24 | 2019-12-12T20:54:39.000Z | 2021-03-25T15:40:26.000Z | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2020-10-21T23:01:06.000Z | 2021-04-22T09:59:50.000Z | ramses_rf/protocol/helpers.py | zxdavb/evohome_rf | dd7233abde1c3b1e645cfabcf3ccc96d0d2c381b | [
"MIT"
] | 9 | 2019-12-03T21:05:11.000Z | 2021-04-02T11:41:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
"""RAMSES RF - Protocol/Transport layer.
Helper functions.
"""
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):... | 34.14791 | 88 | 0.591149 |
import ctypes
import sys
import time
from datetime import datetime as dt
from typing import Optional, Union
from .const import DEVICE_TYPES, NON_DEVICE_ID, NUL_DEVICE_ID
class FILETIME(ctypes.Structure):
_fields_ = [("dwLowDateTime", ctypes.c_uint), ("dwHighDateTime", ctypes.c_uint)]
def dt_now() -> dt:
... | true | true |
f736682c03031c943fab6c203b47c7184e8ec07d | 12,492 | py | Python | models/resnet_lgdv2.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | models/resnet_lgdv2.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | models/resnet_lgdv2.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
import numpy as np
__all__ = [
'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnet200'
]
def look_bottleneck_global(glo):
... | 32.030769 | 130 | 0.53186 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import math
from functools import partial
import numpy as np
__all__ = [
'ResNet', 'resnet10', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnet200'
]
def look_bottleneck_global(glo):
... | true | true |
f7366835c02e403a339394e5e63ac8c59828af30 | 123 | py | Python | src/Stage/stage4.py | yuduki24/Rikako | 989a0499d06bd37b5a6d826b1fb898369a50bbfb | [
"MIT"
] | null | null | null | src/Stage/stage4.py | yuduki24/Rikako | 989a0499d06bd37b5a6d826b1fb898369a50bbfb | [
"MIT"
] | null | null | null | src/Stage/stage4.py | yuduki24/Rikako | 989a0499d06bd37b5a6d826b1fb898369a50bbfb | [
"MIT"
] | null | null | null | from Stage.stage import *
class Stage4(Stage):
def deployEnemy(self):
Boss2((self.scr_rect.width//2, 200)) | 24.6 | 44 | 0.650407 | from Stage.stage import *
class Stage4(Stage):
def deployEnemy(self):
Boss2((self.scr_rect.width//2, 200)) | true | true |
f73669c910733fc3bbdb968d1c678045f94256d1 | 999 | py | Python | velhot/migrations/0004_profile.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/migrations/0004_profile.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | velhot/migrations/0004_profile.py | matiasmane/BWA | 1dd3e68362fafb40e615f1485f2cdf4ad74837af | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-11-20 12:48
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 35.678571 | 145 | 0.638639 |
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('velhot', '0003_friend'),
]
operat... | true | true |
f7366a3d5b380afad1909ab74d0d3a13473a6311 | 43,835 | py | Python | statsmodels/tsa/tests/results/arima111nc_css_results.py | yarikoptic/statsmodels | f990cb1a1ef0c9883c9394444e6f9d027efabec6 | [
"BSD-3-Clause"
] | 34 | 2018-07-13T11:30:46.000Z | 2022-01-05T13:48:10.000Z | venv/lib/python3.6/site-packages/statsmodels/tsa/tests/results/arima111nc_css_results.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 6 | 2015-08-28T16:59:03.000Z | 2019-04-12T22:29:01.000Z | venv/lib/python3.6/site-packages/statsmodels/tsa/tests/results/arima111nc_css_results.py | HeyWeiPan/vnpy_crypto | 844381797a475a01c05a4e162592a5a6e3a48032 | [
"MIT"
] | 28 | 2015-04-01T20:02:25.000Z | 2021-07-03T00:09:28.000Z | import numpy as np
llf = np.array([-242.89663276735])
nobs = np.array([ 202])
k = np.array([ 3])
k_exog = np.array([ 1])
sigma = np.array([ .8053519404535])
chi2 = np.array([ 15723.381396967])
df_model = np.array([ 2])
k_ar = np.array([ 1])
k... | 34.407378 | 229 | 0.401278 | import numpy as np
llf = np.array([-242.89663276735])
nobs = np.array([ 202])
k = np.array([ 3])
k_exog = np.array([ 1])
sigma = np.array([ .8053519404535])
chi2 = np.array([ 15723.381396967])
df_model = np.array([ 2])
k_ar = np.array([ 1])
k... | true | true |
f7366a7972aa995d6c049ca89cf300ad3dc9460e | 1,234 | py | Python | script.py | DarkDevil1265/Malluunlimitedfilterbot | b8e8795e1c167a40070a9a698802122c461fcfda | [
"MIT"
] | 1 | 2021-09-19T17:49:37.000Z | 2021-09-19T17:49:37.000Z | script.py | DarkDevil1265/Malluunlimitedfilterbot | b8e8795e1c167a40070a9a698802122c461fcfda | [
"MIT"
] | null | null | null | script.py | DarkDevil1265/Malluunlimitedfilterbot | b8e8795e1c167a40070a9a698802122c461fcfda | [
"MIT"
] | 1 | 2021-09-20T08:20:14.000Z | 2021-09-20T08:20:14.000Z | class Script(object):
START_MSG = """<b>Hello {} How are you,
I'm an advanced filter bot with many capabilities!
Made by @RJMALLU
See <i>/help</i> for commands and more details.</b>
"""
HELP_MSG = """
<i>Add me as admin in your group and start filtering :)</i>
<b>Basic Commands;</b>
/start - Check if I'... | 19.903226 | 120 | 0.658023 | class Script(object):
START_MSG = """<b>Hello {} How are you,
I'm an advanced filter bot with many capabilities!
Made by @RJMALLU
See <i>/help</i> for commands and more details.</b>
"""
HELP_MSG = """
<i>Add me as admin in your group and start filtering :)</i>
<b>Basic Commands;</b>
/start - Check if I'... | true | true |
f7366b93b511f5c29ce318235f5766cca881d088 | 27,114 | py | Python | sphinx/writers/text.py | zzqcn/sphinx-doc | d7adc8efd7f71bb3f1633bf6cde19273fc95b977 | [
"BSD-2-Clause"
] | 2 | 2017-07-05T09:57:33.000Z | 2017-11-14T23:05:53.000Z | sphinx/writers/text.py | zzqcn/sphinx-doc | d7adc8efd7f71bb3f1633bf6cde19273fc95b977 | [
"BSD-2-Clause"
] | 1 | 2019-01-17T14:26:22.000Z | 2019-01-17T22:56:26.000Z | sphinx/writers/text.py | zzqcn/sphinx-doc | d7adc8efd7f71bb3f1633bf6cde19273fc95b977 | [
"BSD-2-Clause"
] | 1 | 2017-08-31T14:33:03.000Z | 2017-08-31T14:33:03.000Z | # -*- coding: utf-8 -*-
"""
sphinx.writers.text
~~~~~~~~~~~~~~~~~~~
Custom docutils writer for plain text.
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import re
import textwrap
from itertools import groupby
import warnings
... | 27.667347 | 92 | 0.579996 | import os
import re
import textwrap
from itertools import groupby
import warnings
from six.moves import zip_longest
from docutils import nodes, writers
from docutils.utils import column_width
from sphinx import addnodes
from sphinx.deprecation import RemovedInSphinx16Warning
from sphinx.locale import admonitionlabel... | true | true |
f7366bb4541a785a76fcbf18c40fbef0d57f5292 | 8,605 | bzl | Python | scala/private/rules/scala_library.bzl | tian000/rules_scala | b3fc6a26db404ce904f98d525ae27a21d3f49f06 | [
"Apache-2.0"
] | null | null | null | scala/private/rules/scala_library.bzl | tian000/rules_scala | b3fc6a26db404ce904f98d525ae27a21d3f49f06 | [
"Apache-2.0"
] | null | null | null | scala/private/rules/scala_library.bzl | tian000/rules_scala | b3fc6a26db404ce904f98d525ae27a21d3f49f06 | [
"Apache-2.0"
] | null | null | null | load("@io_bazel_rules_scala//scala:providers.bzl", "create_scala_provider")
load(
"@io_bazel_rules_scala//scala/private:common.bzl",
"collect_jars",
"collect_srcjars",
"sanitize_string_for_usage",
"write_manifest",
)
load(
"@io_bazel_rules_scala//scala/private:common_attributes.bzl",
"common... | 30.842294 | 142 | 0.708542 | load("@io_bazel_rules_scala//scala:providers.bzl", "create_scala_provider")
load(
"@io_bazel_rules_scala//scala/private:common.bzl",
"collect_jars",
"collect_srcjars",
"sanitize_string_for_usage",
"write_manifest",
)
load(
"@io_bazel_rules_scala//scala/private:common_attributes.bzl",
"common... | true | true |
f7366c0f1b8be7fbd52f8cb9f823f28077e8b0d4 | 2,736 | py | Python | test/nn/conv/test_film_conv.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | 1 | 2022-02-21T13:23:19.000Z | 2022-02-21T13:23:19.000Z | test/nn/conv/test_film_conv.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | null | null | null | test/nn/conv/test_film_conv.py | LingxiaoShawn/pytorch_geometric | 50b7bfc4a59b5b6f7ec547ff862985f3b2e22798 | [
"MIT"
] | null | null | null | import torch
from torch_sparse import SparseTensor
from torch_geometric.nn import FiLMConv
def test_film_conv():
x1 = torch.randn(4, 4)
x2 = torch.randn(2, 16)
edge_index = torch.tensor([[0, 1, 1, 2, 2, 3], [0, 0, 1, 0, 1, 1]])
edge_type = torch.tensor([0, 1, 1, 0, 0, 1])
row, col = edge_index
... | 40.235294 | 78 | 0.621711 | import torch
from torch_sparse import SparseTensor
from torch_geometric.nn import FiLMConv
def test_film_conv():
x1 = torch.randn(4, 4)
x2 = torch.randn(2, 16)
edge_index = torch.tensor([[0, 1, 1, 2, 2, 3], [0, 0, 1, 0, 1, 1]])
edge_type = torch.tensor([0, 1, 1, 0, 0, 1])
row, col = edge_index
... | true | true |
f7366dd76a0f042bd795bb1d0879f0ea7217a5ad | 10,253 | py | Python | qa/rpc-tests/listtransactions.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | null | null | null | qa/rpc-tests/listtransactions.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | null | null | null | qa/rpc-tests/listtransactions.py | unifycoin/unifycoin | 7d0d5245610daab81e8b124c9b4dc03a73020b8f | [
"MIT"
] | 2 | 2019-06-28T12:47:30.000Z | 2019-12-16T04:56:50.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the listtransactions API
from test_framework.test_framework import BitcoinTestFramework
from ... | 49.771845 | 113 | 0.598752 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, COIN
from io import BytesIO
def txFromHex(hexstring):
tx = CTransaction()
f = BytesIO(hex_str_to_bytes(hexstring))
tx.deserialize(f)
return tx
class List... | true | true |
f7366fb0623d365f2c6a0afdb0e6e6f704b8c08b | 431 | py | Python | output/models/ms_data/element/elem_z003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/element/elem_z003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/element/elem_z003_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.element.elem_z003_xsd.elem_z003 import (
AType,
BType,
Container1,
CType,
DType,
EType,
FType,
GType,
A,
B,
C,
Container,
D,
E,
F,
G,
)
__all__ = [
"AType",
"BType",
"Container1",
"CType",
"DType",
"EType... | 11.342105 | 67 | 0.433875 | from output.models.ms_data.element.elem_z003_xsd.elem_z003 import (
AType,
BType,
Container1,
CType,
DType,
EType,
FType,
GType,
A,
B,
C,
Container,
D,
E,
F,
G,
)
__all__ = [
"AType",
"BType",
"Container1",
"CType",
"DType",
"EType... | true | true |
f7366fb79cc98cc8da4a20593adf754830266e3b | 6,539 | py | Python | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 1 | 2021-08-18T13:17:10.000Z | 2021-08-18T13:17:10.000Z | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 7 | 2018-02-18T12:29:20.000Z | 2020-05-14T18:08:48.000Z | bibpy/lexers/base_lexer.py | MisanthropicBit/bibpy | 3195790105544672f622ed893213a627b5280f2b | [
"BSD-3-Clause"
] | 3 | 2018-02-17T18:27:43.000Z | 2022-01-20T02:28:58.000Z | # -*- coding: utf-8 -*-
"""Base class for all lexers."""
import re
from funcparserlib.lexer import Token
class LexerError(Exception):
"""General lexer error."""
def __init__(self, msg, pos, char, lnum, brace_level, line):
"""Initialise with information on where the error occurred."""
self.m... | 29.32287 | 79 | 0.562777 |
import re
from funcparserlib.lexer import Token
class LexerError(Exception):
def __init__(self, msg, pos, char, lnum, brace_level, line):
self.msg = msg
self.pos = pos
self.char = char
self.lnum = lnum
self.brace_level = brace_level
self.line = line
def __st... | true | true |
f736700ef45c4a87f90b99dc2b55cbaf2bc3c59d | 7,834 | py | Python | main/pronouns.py | LucilleN/MH-Stigma-in-Masked-LMs | 9e30817cb32358a8e6004faf7ef88ad69d6148f6 | [
"MIT"
] | 1 | 2022-03-08T04:45:49.000Z | 2022-03-08T04:45:49.000Z | main/pronouns.py | LucilleN/MH-Stigma-in-Masked-LMs | 9e30817cb32358a8e6004faf7ef88ad69d6148f6 | [
"MIT"
] | null | null | null | main/pronouns.py | LucilleN/MH-Stigma-in-Masked-LMs | 9e30817cb32358a8e6004faf7ef88ad69d6148f6 | [
"MIT"
] | null | null | null | # Comparing He vs She
from transformers import pipeline
import pandas as pd
from utils import diagnoses, get_target_probability, get_top_k, print_stats, plot_male_and_female
import matplotlib.pylab as plt
import seaborn as sns
import argparse
templates = [
"<mask> has [diagnosis]",
"<mask> is diagnosed with [d... | 44.765714 | 132 | 0.659433 | from transformers import pipeline
import pandas as pd
from utils import diagnoses, get_target_probability, get_top_k, print_stats, plot_male_and_female
import matplotlib.pylab as plt
import seaborn as sns
import argparse
templates = [
"<mask> has [diagnosis]",
"<mask> is diagnosed with [diagnosis]",
"<mask... | true | true |
f73670892a881a9abc5732fb1b106ac4e17ad21b | 18,781 | py | Python | PythonVirtEnv/Lib/site-packages/zmq/_future.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 5 | 2022-01-20T22:59:04.000Z | 2022-02-06T06:11:35.000Z | PythonVirtEnv/Lib/site-packages/zmq/_future.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | PythonVirtEnv/Lib/site-packages/zmq/_future.py | zuhorski/EPL_Project | 2d2417652879cfbe33c44c003ad77b7222590849 | [
"MIT"
] | null | null | null | """Future-returning APIs for coroutines."""
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
from collections import namedtuple, deque
from itertools import chain
from typing import Type
from zmq import EVENTS, POLLOUT, POLLIN
import zmq as _zmq
_FutureEvent = namedtuple(... | 33.00703 | 94 | 0.569139 |
from collections import namedtuple, deque
from itertools import chain
from typing import Type
from zmq import EVENTS, POLLOUT, POLLIN
import zmq as _zmq
_FutureEvent = namedtuple('_FutureEvent', ('future', 'kind', 'kwargs', 'msg', 'timer'))
class _AsyncPoller(_zmq.Poller):
_socket_class = None
def pol... | true | true |
f736712970df93b5bef6cd0469bab29486ab504a | 12,232 | py | Python | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/09-MoreImplementingClasses/src/m2_baby_class.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | # can't get the output to stop putting extra space after baby name before punctuation.
"""
A Baby class and functions that use/test it.
Authors: Dave Fisher, David Mutchler, Vibha Alangar, Matt Boutell,
Mark Hays, Amanda Stouder, Derek Whitley, their colleagues,
and Seth Mutchler.
""" # DONE: ... | 37.066667 | 86 | 0.563685 |
import random
def main():
print("UN-comment the following TESTS, one by one, when you are ready.")
# UN-comment the following, one by one, when you are ready to TEST.
run_test_1()
run_test_2()
###############################################################################
# Done: 2. In this modu... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.