hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df1123e3caac463db3366dc0b84776d6af6012ac | 5,347 | py | Python | pyBreakDown/explainer.py | bondyra/pyBreakDown | 56fecfd1dfa40057b21f08b4dace5620827e06ce | [
"Apache-2.0"
] | 44 | 2018-06-22T15:45:09.000Z | 2022-03-12T13:56:21.000Z | pyBreakDown/explainer.py | bondyra/pyBreakDown | 56fecfd1dfa40057b21f08b4dace5620827e06ce | [
"Apache-2.0"
] | 3 | 2018-08-31T16:05:25.000Z | 2019-07-24T15:21:50.000Z | pyBreakDown/explainer.py | bondyra/pyBreakDown | 56fecfd1dfa40057b21f08b4dace5620827e06ce | [
"Apache-2.0"
] | 3 | 2018-07-25T07:21:23.000Z | 2020-06-30T23:56:45.000Z | import numpy as np
from collections import deque
from blist import blist
from pyBreakDown import explanation as e
class Explainer:
"""
Explainer object.
Parameters
----------
clf : np.array
Sklearn predicition model (regression or classification).
data : np.array
... | 35.646667 | 102 | 0.614924 | import numpy as np
from collections import deque
from blist import blist
from pyBreakDown import explanation as e
class Explainer:
"""
Explainer object.
Parameters
----------
clf : np.array
Sklearn predicition model (regression or classification).
data : np.array
... | 3,243 | 0 | 161 |
229952e6c867c0f7bd3a28294d68436588ae5901 | 4,339 | py | Python | research/controllers/bpc_sysid.py | MinRegret/TigerControl | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 31 | 2019-11-08T06:01:54.000Z | 2021-11-20T04:50:43.000Z | research/controllers/bpc_sysid.py | johnhallman/ctsb | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 32 | 2019-06-27T15:05:04.000Z | 2019-08-07T04:23:47.000Z | research/controllers/bpc_sysid.py | MinRegret/tigercontrol | b1ca0617cbb2198f9d5cb37f725f3d7accbab08f | [
"Apache-2.0"
] | 3 | 2020-09-30T17:06:50.000Z | 2021-04-12T22:39:34.000Z | import matplotlib.pyplot as plt
import jax
import jax.numpy as np
import numpy as onp
import jax.random as random
import tigercontrol
from tigercontrol.utils.random import set_key, generate_key
from tigercontrol.environments import Environment
from tigercontrol.controllers import Controller
from jax import grad,jit
fr... | 36.158333 | 116 | 0.583545 | import matplotlib.pyplot as plt
import jax
import jax.numpy as np
import numpy as onp
import jax.random as random
import tigercontrol
from tigercontrol.utils.random import set_key, generate_key
from tigercontrol.environments import Environment
from tigercontrol.controllers import Controller
from jax import grad,jit
fr... | 448 | 0 | 101 |
dc7da909ae3ec185cb3465412df3ab4eeb4c60e8 | 1,025 | py | Python | vsts/vsts/project_analysis/v4_0/models/__init__.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/project_analysis/v4_0/models/__init__.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/project_analysis/v4_0/models/__init__.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.590909 | 94 | 0.594146 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 0 | 0 |
b8690f6517c43adf620f57ac5263bc71b9cfc82a | 7,324 | py | Python | examples/crm/crm_opt.py | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | examples/crm/crm_opt.py | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | examples/crm/crm_opt.py | tchin-divergent/tacs | 34743b370da4ab6ea16d24de7c574c3fec9d333a | [
"Apache-2.0"
] | null | null | null | # A demonstration of a simple optimization problem in TACS: minimize the
# mass of the CRM model subject to a global stress aggregate constraint
# enforcing that the maximum stress at any quadrature point is less than
# a specified upper bound.
from __future__ import print_function
# Import necessary libraries
impo... | 34.224299 | 78 | 0.635855 | # A demonstration of a simple optimization problem in TACS: minimize the
# mass of the CRM model subject to a global stress aggregate constraint
# enforcing that the maximum stress at any quadrature point is less than
# a specified upper bound.
from __future__ import print_function
# Import necessary libraries
impo... | 3,340 | 0 | 27 |
793a3435ad271681ef7393b64d49014f446d9a50 | 13,152 | py | Python | mlflow/store/file_store.py | kmr0877/mlflow | 04a5fee5df5ea3eaeeb4ce98b0a58425983c8bb0 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:42:17.000Z | 2022-03-13T21:42:17.000Z | mlflow/store/file_store.py | RoyMachineLearning/mlflow | 78a97fc3a11908e71142cc3803b2b0d7b41d83e0 | [
"Apache-2.0"
] | null | null | null | mlflow/store/file_store.py | RoyMachineLearning/mlflow | 78a97fc3a11908e71142cc3803b2b0d7b41d83e0 | [
"Apache-2.0"
] | 1 | 2018-11-30T17:56:47.000Z | 2018-11-30T17:56:47.000Z | import os
import uuid
from mlflow.entities.experiment import Experiment
from mlflow.entities.metric import Metric
from mlflow.entities.param import Param
from mlflow.entities.run import Run
from mlflow.entities.run_data import RunData
from mlflow.entities.run_info import RunInfo
from mlflow.entities.run_status impor... | 45.508651 | 100 | 0.67313 | import os
import uuid
from mlflow.entities.experiment import Experiment
from mlflow.entities.metric import Metric
from mlflow.entities.param import Param
from mlflow.entities.run import Run
from mlflow.entities.run_data import RunData
from mlflow.entities.run_info import RunInfo
from mlflow.entities.run_status impor... | 8,602 | 3,731 | 46 |
14f0ab6c7d2a2c3a3eba643a5442c0cd16897d94 | 3,126 | py | Python | src/models/NamedEntityRecognitionBertModel.py | kryvokhyzha/bert-for-ukranian-ner | 48da40f09cb216ad51a97c303998157858fbe8bc | [
"MIT"
] | null | null | null | src/models/NamedEntityRecognitionBertModel.py | kryvokhyzha/bert-for-ukranian-ner | 48da40f09cb216ad51a97c303998157858fbe8bc | [
"MIT"
] | null | null | null | src/models/NamedEntityRecognitionBertModel.py | kryvokhyzha/bert-for-ukranian-ner | 48da40f09cb216ad51a97c303998157858fbe8bc | [
"MIT"
] | null | null | null | from typing import Dict
import torch
import torch.nn as nn
from transformers import AutoConfig, AutoModel
| 32.5625 | 90 | 0.574536 | from typing import Dict
import torch
import torch.nn as nn
from transformers import AutoConfig, AutoModel
class NamedEntityRecognitionBertModel(nn.Module):
def __init__(
self,
pretrained_model_name: str,
output_dim: int,
lstm_dim: int = 256,
lstm_num_layers: int = 2,
... | 2,860 | 28 | 130 |
a6644745c859767b0ae53add78546e769634ce55 | 16,527 | py | Python | google/cloud/dataproc_v1/types/shared.py | anilreddypuresoftware/python-dataproc | cdf4aec2446f325b062fef74c6c0bef70f47ab71 | [
"Apache-2.0"
] | null | null | null | google/cloud/dataproc_v1/types/shared.py | anilreddypuresoftware/python-dataproc | cdf4aec2446f325b062fef74c6c0bef70f47ab71 | [
"Apache-2.0"
] | null | null | null | google/cloud/dataproc_v1/types/shared.py | anilreddypuresoftware/python-dataproc | cdf4aec2446f325b062fef74c6c0bef70f47ab71 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... | 38.080645 | 116 | 0.65747 | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# 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... | 0 | 0 | 0 |
7eb1d84e057baabeeab3acf8c78fef30d938ea81 | 2,288 | py | Python | logs/logger.py | eliranmaman/WP-Exploiter | 5162e20dcbb33fa1bc31cbbf4333a606aaa31615 | [
"MIT"
] | 8 | 2020-11-27T14:40:00.000Z | 2022-03-23T09:37:56.000Z | logs/logger.py | eliranmaman/WP-Exploiter | 5162e20dcbb33fa1bc31cbbf4333a606aaa31615 | [
"MIT"
] | null | null | null | logs/logger.py | eliranmaman/WP-Exploiter | 5162e20dcbb33fa1bc31cbbf4333a606aaa31615 | [
"MIT"
] | 5 | 2020-11-29T13:03:23.000Z | 2022-03-23T09:38:01.000Z | """
This Package responsible for the logs in the WP-exploiter.
"""
try:
import enum
import asyncio
from datetime import datetime
except BaseException as e:
print("Import Error: ", e)
class LoggerMode(enum.Enum):
"""
:DEVELOP: Will output all the logs to the screen also.
:DEBUG: Will outpu... | 30.506667 | 97 | 0.59222 | """
This Package responsible for the logs in the WP-exploiter.
"""
try:
import enum
import asyncio
from datetime import datetime
except BaseException as e:
print("Import Error: ", e)
class LoggerMode(enum.Enum):
"""
:DEVELOP: Will output all the logs to the screen also.
:DEBUG: Will outpu... | 100 | 0 | 31 |
705f292fc8360585c04efdd11e18c1693e6d1be2 | 3,157 | py | Python | app/controllers/user.py | Axtell-io/Axtell | 2f660450ca2eb70cc0520ad970c9aabdc65a3bb7 | [
"MIT"
] | 15 | 2018-04-20T14:56:59.000Z | 2021-03-31T20:16:29.000Z | app/controllers/user.py | Axtell/Axtell | 2f660450ca2eb70cc0520ad970c9aabdc65a3bb7 | [
"MIT"
] | 148 | 2018-04-17T01:47:44.000Z | 2020-05-14T13:24:03.000Z | app/controllers/user.py | Axtell-io/Axtell | 2f660450ca2eb70cc0520ad970c9aabdc65a3bb7 | [
"MIT"
] | 7 | 2018-06-01T11:15:18.000Z | 2020-08-14T04:24:50.000Z | from config import user_list
from flask import g
from app.helpers.render import render_json, render_error
from app.models.User import User
from app.instances import db
def get_my_profile():
"""
Returns the logged in user's profile or a JSON with `unauthorized: true`
"""
if isinstance(g.user, User):
... | 28.7 | 118 | 0.687995 | from config import user_list
from flask import g
from app.helpers.render import render_json, render_error
from app.models.User import User
from app.instances import db
def get_my_profile():
"""
Returns the logged in user's profile or a JSON with `unauthorized: true`
"""
if isinstance(g.user, User):
... | 924 | 0 | 46 |
5e140da0ba97c3e08bd5f09d7f306ad891d4c321 | 1,823 | py | Python | migrations/versions/77219ff4194a_.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | null | null | null | migrations/versions/77219ff4194a_.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | null | null | null | migrations/versions/77219ff4194a_.py | wanderindev/fyyur | acf3a44ce7fae6b24576a320afd447c0595d76e5 | [
"MIT"
] | 2 | 2020-07-16T22:02:13.000Z | 2020-11-22T21:16:28.000Z | """empty message
Revision ID: 77219ff4194a
Revises: d0605c00c98e
Create Date: 2019-11-18 18:22:03.915031
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "77219ff4194a"
down_revision = "d0605c00c98e"
branch_labels = None... | 25.319444 | 79 | 0.625891 | """empty message
Revision ID: 77219ff4194a
Revises: d0605c00c98e
Create Date: 2019-11-18 18:22:03.915031
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = "77219ff4194a"
down_revision = "d0605c00c98e"
branch_labels = None... | 1,436 | 0 | 46 |
15b7d79eaa7c73eb0c7e19d9e846e5dc469e9a57 | 1,800 | py | Python | app/views/game_views.py | thomasemurphy/django-channels-react-multiplayer | 2d8bbf408442f73cba461beb2ef2b50a33d23cae | [
"MIT"
] | 57 | 2019-08-22T00:02:09.000Z | 2022-03-14T14:46:32.000Z | app/views/game_views.py | aduranil/django-channels-react-hooks-multiplayer | 2d8bbf408442f73cba461beb2ef2b50a33d23cae | [
"MIT"
] | 1 | 2019-08-07T14:09:18.000Z | 2019-08-07T14:09:18.000Z | app/views/game_views.py | aduranil/django-channels-react-hooks-multiplayer | 2d8bbf408442f73cba461beb2ef2b50a33d23cae | [
"MIT"
] | 11 | 2019-11-02T19:38:47.000Z | 2022-01-10T23:37:01.000Z | import json
from rest_framework.views import APIView
from rest_framework import permissions
from rest_framework.authentication import TokenAuthentication
from django.http import HttpResponse
from django.utils import timezone
from datetime import timedelta
from app.models import Game, Winner
| 32.142857 | 71 | 0.718333 | import json
from rest_framework.views import APIView
from rest_framework import permissions
from rest_framework.authentication import TokenAuthentication
from django.http import HttpResponse
from django.utils import timezone
from datetime import timedelta
from app.models import Game, Winner
class GameCreateView(API... | 898 | 512 | 92 |
f82919fd46b1e7410eb5db11012df992afdf08c9 | 463 | py | Python | Unit 6 Lists and Dictionary/Lesson27 Dictionary Functions.py | ItsMrTurtle/PythonChris | 4513dea336e68f48fabf480ad87bc538a323c2cd | [
"MIT"
] | null | null | null | Unit 6 Lists and Dictionary/Lesson27 Dictionary Functions.py | ItsMrTurtle/PythonChris | 4513dea336e68f48fabf480ad87bc538a323c2cd | [
"MIT"
] | null | null | null | Unit 6 Lists and Dictionary/Lesson27 Dictionary Functions.py | ItsMrTurtle/PythonChris | 4513dea336e68f48fabf480ad87bc538a323c2cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun May 10 22:59:10 2020
@author: Christopher Cheng
"""
# The value is the function mapped
areas = {"sq": square, "ci": circle, "eqtri": equal_tri}
# When accessing the dictionary keys, you can pass a parameter if it's a function
n = 2
print(areas["sq"](n))
print(areas["ci"](... | 19.291667 | 82 | 0.632829 | # -*- coding: utf-8 -*-
"""
Created on Sun May 10 22:59:10 2020
@author: Christopher Cheng
"""
def square(x):
return x*x
def circle(r):
return 3.14*r*r
def equal_tri (s):
return (s*s)*(3**0.5)/4
# The value is the function mapped
areas = {"sq": square, "ci": circle, "eqtri": equal_tri}
# When accessi... | 46 | 0 | 69 |
bf70a2f46f36414b602c4aa94a044b1a0722e51e | 1,234 | py | Python | FastXML/fastxml/fastxml/weights.py | anonymouslorem/library_identification_vulnerability_report | 3eb1916b25bcf885640ed19954377edf45f7498a | [
"MIT"
] | 1 | 2022-01-05T02:27:43.000Z | 2022-01-05T02:27:43.000Z | FastXML/fastxml/fastxml/weights.py | anonymouslorem/library_identification_vulnerability_report | 3eb1916b25bcf885640ed19954377edf45f7498a | [
"MIT"
] | null | null | null | FastXML/fastxml/fastxml/weights.py | anonymouslorem/library_identification_vulnerability_report | 3eb1916b25bcf885640ed19954377edf45f7498a | [
"MIT"
] | null | null | null | from __future__ import division
from builtins import range
from past.utils import old_div
from collections import Counter
import numpy as np
def propensity(y, A=0.55, B=1.5):
"""
Computes propensity scores based on ys
"""
N, Nl, ml = metrics(y)
C = (np.log(N) - 1) * (B + 1) ** A
wei... | 24.196078 | 62 | 0.529173 | from __future__ import division
from builtins import range
from past.utils import old_div
from collections import Counter
import numpy as np
def metrics(y):
Nl = Counter(yi for ys in y for yi in ys)
N = len(y)
return N, Nl, max(Nl) + 1
def uniform(y):
N, Nl, ml = metrics(y)
return np.... | 671 | 0 | 100 |
c8a7e8091e275c74b74923416fd46e074f166524 | 8,093 | py | Python | lib/bes/vfs/vfs_cli_args.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/vfs/vfs_cli_args.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | lib/bes/vfs/vfs_cli_args.py | reconstruir/bes | 82ff54b2dadcaef6849d7de424787f1dedace85c | [
"Apache-2.0"
] | null | null | null | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import os
from os import path
from bes.key_value.key_value_list import key_value_list
from bes.common.check import check
from bes.system.log import log
from .vfs_cli_command import vfs_cli_command
from .vfs_list_options import... | 52.551948 | 96 | 0.602867 | #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
import os
from os import path
from bes.key_value.key_value_list import key_value_list
from bes.common.check import check
from bes.system.log import log
from .vfs_cli_command import vfs_cli_command
from .vfs_list_options import... | 7,405 | 6 | 341 |
b7a2a12b79393a04ce7507597c1b70b004542d82 | 1,584 | py | Python | nasws/dataset/image_dataloader.py | kcyu2014/nas-landmarkreg | a00c3619bf4042e446e1919087f0b09fe9fa3a65 | [
"MIT"
] | 8 | 2021-04-13T01:52:11.000Z | 2022-03-30T03:53:12.000Z | nasws/dataset/image_dataloader.py | kcyu2014/nas-landmarkreg | a00c3619bf4042e446e1919087f0b09fe9fa3a65 | [
"MIT"
] | 4 | 2021-05-29T01:41:00.000Z | 2021-08-24T09:40:43.000Z | nasws/dataset/image_dataloader.py | kcyu2014/nas-landmarkreg | a00c3619bf4042e446e1919087f0b09fe9fa3a65 | [
"MIT"
] | null | null | null | from argparse import Namespace
from torchvision.datasets import CIFAR10
import numpy as np
import torch
import utils
DEFAULT_ARGS=Namespace(
dataset='cifar10',
data='data',
cutout=None,
cutout_length=None,
train_portion=0.9,
batch_size=256,
evaluate_batch_size=256,
)
| 35.2 | 118 | 0.704545 | from argparse import Namespace
from torchvision.datasets import CIFAR10
import numpy as np
import torch
import utils
DEFAULT_ARGS=Namespace(
dataset='cifar10',
data='data',
cutout=None,
cutout_length=None,
train_portion=0.9,
batch_size=256,
evaluate_batch_size=256,
)
def load_dataset(ar... | 1,262 | 0 | 23 |
e05b6cd6f8a86f6d715a3067acf15d84fdec1425 | 14,960 | py | Python | test/test_multiinvest.py | AlOussama/PyPSA | 41c5666a132c4e637fc07e6872f3947acfa2166d | [
"MIT"
] | null | null | null | test/test_multiinvest.py | AlOussama/PyPSA | 41c5666a132c4e637fc07e6872f3947acfa2166d | [
"MIT"
] | null | null | null | test/test_multiinvest.py | AlOussama/PyPSA | 41c5666a132c4e637fc07e6872f3947acfa2166d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 10:21:16 2021
@author: fabian
"""
import pypsa
import pytest
import os
import pandas as pd
from numpy.testing import assert_array_almost_equal as equal
from pandas import IndexSlice as idx
from pypsa.descriptors import get_activity_mask
@pytest... | 32.663755 | 88 | 0.658356 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 2 10:21:16 2021
@author: fabian
"""
import pypsa
import pytest
import os
import pandas as pd
from numpy.testing import assert_array_almost_equal as equal
from pandas import IndexSlice as idx
from pypsa.descriptors import get_activity_mask
@pytest... | 14,000 | 0 | 572 |
ddb1f1e2c0ff6106c5c69d841334a429fafe352a | 1,600 | py | Python | examples/favourite-music-example.py | nonkung51/IntentParser | 37d125dc2a1627c055ab5313fde96369462e034f | [
"Apache-2.0"
] | 8 | 2017-05-11T11:30:21.000Z | 2021-02-17T22:27:22.000Z | examples/favourite-music-example.py | nonkung51/IntentParser | 37d125dc2a1627c055ab5313fde96369462e034f | [
"Apache-2.0"
] | 1 | 2017-10-19T07:56:36.000Z | 2017-10-19T07:56:36.000Z | examples/favourite-music-example.py | nonkung51/IntentParser | 37d125dc2a1627c055ab5313fde96369462e034f | [
"Apache-2.0"
] | 7 | 2017-05-11T15:49:02.000Z | 2020-09-19T08:20:12.000Z | import intentparser as ip
__author__ = 'Nonthakon Jitchiranant'
<<<<<<< HEAD
intent = intentparser.intentParser({
'description' : {
"type" : 'FavMusicIntent',
"args" : [(1, "musics_types")],
"keyword" : [
(0, "musics_keyword"),
... | 32 | 103 | 0.473125 | import intentparser as ip
__author__ = 'Nonthakon Jitchiranant'
<<<<<<< HEAD
intent = intentparser.intentParser({
'description' : {
"type" : 'FavMusicIntent',
"args" : [(1, "musics_types")],
"keyword" : [
(0, "musics_keyword"),
... | 0 | 0 | 0 |
b2508bce449d0f7386f79e8e038e5eb5c9777194 | 677 | py | Python | client/exe_package.py | ApolloNano/nano-dpow | 14d414ad2d12cdfee8e90fb4873ba639dc5e90fe | [
"MIT"
] | 2 | 2021-05-20T10:32:14.000Z | 2021-07-13T07:18:03.000Z | client/exe_package.py | ApolloNano/nano-dpow | 14d414ad2d12cdfee8e90fb4873ba639dc5e90fe | [
"MIT"
] | null | null | null | client/exe_package.py | ApolloNano/nano-dpow | 14d414ad2d12cdfee8e90fb4873ba639dc5e90fe | [
"MIT"
] | 1 | 2021-12-24T01:56:22.000Z | 2021-12-24T01:56:22.000Z | from cx_Freeze import setup, Executable
import os
additional_packages = []
additional_mods = []
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) # directory where this file is in
DIST_DIR = os.path.join(PROJECT_DIR, 'release\\bin') # directory where all the final builds will be found
BUILD_DIR = os.... | 39.823529 | 114 | 0.701625 | from cx_Freeze import setup, Executable
import os
additional_packages = []
additional_mods = []
PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) # directory where this file is in
DIST_DIR = os.path.join(PROJECT_DIR, 'release\\bin') # directory where all the final builds will be found
BUILD_DIR = os.... | 0 | 0 | 0 |
5d8e1ce0406fd80c88b840adcf0b8b12832e9306 | 25,513 | py | Python | plugins/pcr/plugins/portunedata/luck_desc.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | plugins/pcr/plugins/portunedata/luck_desc.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | plugins/pcr/plugins/portunedata/luck_desc.py | liangzimiao/miyubot | c2788712255e39348c8980c8ace2f6f75fb6621c | [
"Apache-2.0"
] | null | null | null | luck_desc = [
{
"charaid": ["1", "2"],
"_name": "凯露",
"type": [
{
"good-luck": 10,
"content": "仅限今天而已!别想多了!!"
},
{
"good-luck": 8,
"content": "宜抽卡﹁十连五彩不是梦﹂"
},
{
... | 24.484645 | 56 | 0.265982 | luck_desc = [
{
"charaid": ["1", "2"],
"_name": "凯露",
"type": [
{
"good-luck": 10,
"content": "仅限今天而已!别想多了!!"
},
{
"good-luck": 8,
"content": "宜抽卡﹁十连五彩不是梦﹂"
},
{
... | 0 | 0 | 0 |
d938e3733133331253646f81cfe360473ca97f6f | 1,615 | py | Python | GRU_train.py | ErrorOverflow/JRJ_baseline | b666a126560a06cf4b1c10947896f917bf5cb17d | [
"MIT"
] | null | null | null | GRU_train.py | ErrorOverflow/JRJ_baseline | b666a126560a06cf4b1c10947896f917bf5cb17d | [
"MIT"
] | null | null | null | GRU_train.py | ErrorOverflow/JRJ_baseline | b666a126560a06cf4b1c10947896f917bf5cb17d | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import pandas as pd
from torch.utils.data import DataLoader
from sklearn.preprocessing import StandardScaler
from models import GRU, rmse_loss
from Dataset import BikeDataSet
if __name__ == '__main__':
device = torch.device('c... | 29.363636 | 103 | 0.627864 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import pandas as pd
from torch.utils.data import DataLoader
from sklearn.preprocessing import StandardScaler
from models import GRU, rmse_loss
from Dataset import BikeDataSet
class Trainer():
def __init__(self, device, lrate=0.... | 439 | -5 | 103 |
02072db99e88bdfa7f2da50953cff83f7c70c418 | 14,903 | py | Python | tardis_minimal_model.py | jamesgillanders/tardisanalysis | b5c27784d3d1db224c629a9d8418a0d126d2f1c8 | [
"BSD-3-Clause"
] | 5 | 2015-08-25T15:00:37.000Z | 2021-06-24T16:53:30.000Z | tardis_minimal_model.py | jamesgillanders/tardisanalysis | b5c27784d3d1db224c629a9d8418a0d126d2f1c8 | [
"BSD-3-Clause"
] | 26 | 2015-08-25T10:32:48.000Z | 2021-04-26T10:59:11.000Z | tardis_minimal_model.py | jamesgillanders/tardisanalysis | b5c27784d3d1db224c629a9d8418a0d126d2f1c8 | [
"BSD-3-Clause"
] | 15 | 2015-08-25T10:19:54.000Z | 2021-05-22T12:10:42.000Z | # -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
#
# File Name : tardis_minimal_model.py
#
# Purpose :
#
# Creation Date : 18-02-2016
#
# Last Modified : Tue 02 Aug 2016 15:09:26 CEST
#
# Created By :
#
# _._._._._._._._._._._._._._._._._._._._._.
"""This module provides an interface object which holds the essential
i... | 41.512535 | 98 | 0.625512 | # -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
#
# File Name : tardis_minimal_model.py
#
# Purpose :
#
# Creation Date : 18-02-2016
#
# Last Modified : Tue 02 Aug 2016 15:09:26 CEST
#
# Created By :
#
# _._._._._._._._._._._._._._._._._._._._._.
"""This module provides an interface object which holds the essential
i... | 1,524 | 0 | 134 |
3ff3edecc70482cdfe0528872279d2c71838e579 | 9,047 | py | Python | core/game.py | VitoGentile/gestaspy | 65af899bcce1b2dc167b517e6d4eca4f599e940d | [
"MIT-0"
] | null | null | null | core/game.py | VitoGentile/gestaspy | 65af899bcce1b2dc167b517e6d4eca4f599e940d | [
"MIT-0"
] | 3 | 2021-06-09T07:40:21.000Z | 2021-06-10T07:47:53.000Z | core/game.py | VitoGentile/gestaspy | 65af899bcce1b2dc167b517e6d4eca4f599e940d | [
"MIT-0"
] | null | null | null | import copy
import glob
import mss
import os
import pygame
import random
import sys
from PIL import Image, ImageOps
from threading import Timer
from core.device_manager import HandJointsFrame
from core.kinect_manager import KinectManager
CRACK_PATHS = glob.glob(os.path.join(resource_path(), "assets", "cracks", "*.p... | 35.900794 | 116 | 0.619432 | import copy
import glob
import mss
import os
import pygame
import random
import sys
from PIL import Image, ImageOps
from threading import Timer
from core.device_manager import HandJointsFrame
from core.kinect_manager import KinectManager
def resource_path(relative_path=""):
try:
base_path = sys._MEIPASS
... | 8,224 | 9 | 338 |
18250f7a596153e2935e92b7ebb3e0cae7594840 | 127 | py | Python | test/test_grammar.py | yuan-xy/marso | 474c565fecc74a322bc8da14d92b066df7345a1a | [
"PSF-2.0"
] | null | null | null | test/test_grammar.py | yuan-xy/marso | 474c565fecc74a322bc8da14d92b066df7345a1a | [
"PSF-2.0"
] | 2 | 2020-05-28T19:29:09.000Z | 2021-03-01T03:12:11.000Z | test/test_grammar.py | yuan-xy/marso | 474c565fecc74a322bc8da14d92b066df7345a1a | [
"PSF-2.0"
] | null | null | null | import marso
import pytest
| 14.111111 | 43 | 0.708661 | import marso
import pytest
def test_non_unicode():
with pytest.raises(UnicodeDecodeError):
marso.parse(b'\xe4')
| 75 | 0 | 23 |
1bc3ac1de46b848dcbb329993e3f6741c567b36a | 1,559 | py | Python | users/views.py | sakshipatil16/Knowledge-sharing-platform | b6638a5eee33dd149fabf1c655ace4a4226decfb | [
"bzip2-1.0.6"
] | 1 | 2021-05-09T08:18:49.000Z | 2021-05-09T08:18:49.000Z | users/views.py | sakshipatil16/Knowledge-sharing-platform | b6638a5eee33dd149fabf1c655ace4a4226decfb | [
"bzip2-1.0.6"
] | 9 | 2021-03-19T01:11:35.000Z | 2022-03-12T00:20:13.000Z | users/views.py | sakshipatil16/Ease-Sharing | b6638a5eee33dd149fabf1c655ace4a4226decfb | [
"bzip2-1.0.6"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .forms import UserRegisterForm,UserUpdateForm,ProfileUpdateForm
# Create your views here.
@login_required
| 33.891304 | 112 | 0.640795 | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.contrib import messages
from .forms import UserRegisterForm,UserUpdateForm,ProfileUpdateForm
# Create your views here.
def register(request... | 1,195 | 0 | 44 |
100287e2582ac20c1ff38ebd18403895b753a9cc | 236 | py | Python | impressiveUploader/uploader/api/serializers.py | nightwarriorftw/ImpressiveUploader | 83331b5a8a0ce92e45e2a9616903d9ae6cad3955 | [
"MIT"
] | null | null | null | impressiveUploader/uploader/api/serializers.py | nightwarriorftw/ImpressiveUploader | 83331b5a8a0ce92e45e2a9616903d9ae6cad3955 | [
"MIT"
] | 5 | 2021-03-30T12:42:56.000Z | 2021-09-22T18:36:11.000Z | impressiveUploader/uploader/api/serializers.py | nightwarriorftw/ImpressiveUploader | 83331b5a8a0ce92e45e2a9616903d9ae6cad3955 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from uploader.models import UploadFileModel
| 26.222222 | 56 | 0.728814 | from rest_framework import serializers
from uploader.models import UploadFileModel
class UploadFileSerializer(serializers.ModelSerializer):
class Meta:
model = UploadFileModel
fields = ['name', 'type', 'file']
| 0 | 130 | 23 |
b68162c2c306c48d25d597db626a8453aac6c24e | 5,498 | py | Python | tests/api.py | SYNchroACK/django-rest-framework-client | 54fce962df9e39217dbc77090fd4d2be7d5a028d | [
"MIT"
] | null | null | null | tests/api.py | SYNchroACK/django-rest-framework-client | 54fce962df9e39217dbc77090fd4d2be7d5a028d | [
"MIT"
] | null | null | null | tests/api.py | SYNchroACK/django-rest-framework-client | 54fce962df9e39217dbc77090fd4d2be7d5a028d | [
"MIT"
] | null | null | null | import sys
import json
import mock
import requests
import requests_mock
import unittest2 as unittest
from drf_client.connection import Api
from drf_client.exceptions import HttpClientError, HttpServerError
| 29.089947 | 92 | 0.550382 | import sys
import json
import mock
import requests
import requests_mock
import unittest2 as unittest
from drf_client.connection import Api
from drf_client.exceptions import HttpClientError, HttpServerError
class ApiTestCase(unittest.TestCase):
api = None
def setUp(self):
options = {
'DOM... | 4,521 | 745 | 23 |
16c7dbce9b6560395e52a58920fa154e4e7d4924 | 1,245 | py | Python | utils/log.py | csmanioto/CTA | 3f23d68627a797333d6bd1e084615a1ee7c3bdc4 | [
"MIT"
] | null | null | null | utils/log.py | csmanioto/CTA | 3f23d68627a797333d6bd1e084615a1ee7c3bdc4 | [
"MIT"
] | null | null | null | utils/log.py | csmanioto/CTA | 3f23d68627a797333d6bd1e084615a1ee7c3bdc4 | [
"MIT"
] | null | null | null | import logging
import colorlog
| 26.489362 | 62 | 0.616867 | import logging
import colorlog
def init_logger(dunder_name, testing_mode) -> logging.Logger:
log_format = (
'%(asctime)s - '
'%(name)s - '
'%(funcName)s - '
'%(levelname)s - '
'%(message)s'
)
bold_seq = '\033[1m'
colorlog_format = (
f'{bold_s... | 1,189 | 0 | 24 |
672c61024dae50aad5e63365121ad628699a8cbf | 240 | py | Python | vomitbin/utils.py | zifnab06/vomitbin | d86e4de5158c42c52c907326f6ae102600c43eab | [
"MIT"
] | null | null | null | vomitbin/utils.py | zifnab06/vomitbin | d86e4de5158c42c52c907326f6ae102600c43eab | [
"MIT"
] | null | null | null | vomitbin/utils.py | zifnab06/vomitbin | d86e4de5158c42c52c907326f6ae102600c43eab | [
"MIT"
] | null | null | null | import base64
import hashlib
import datetime
| 30 | 118 | 0.729167 | import base64
import hashlib
import datetime
def new_paste_id(value):
date = datetime.datetime.utcnow().isoformat()
return base64.urlsafe_b64encode(hashlib.sha1('{}{}'.format(date, value).encode('utf-8')).digest()).decode('utf-8')
| 172 | 0 | 23 |
07852aa44513bd0e88975ef54120974c83e3ccc6 | 4,389 | py | Python | bauble/plugins.py | Bauble/bauble.api | 183c97fda076ea870e21e70ecf89a2a94a7f5722 | [
"BSD-3-Clause"
] | null | null | null | bauble/plugins.py | Bauble/bauble.api | 183c97fda076ea870e21e70ecf89a2a94a7f5722 | [
"BSD-3-Clause"
] | 1 | 2015-02-05T13:15:00.000Z | 2015-02-05T13:15:00.000Z | bauble/plugins.py | Bauble/bauble.api | 183c97fda076ea870e21e70ecf89a2a94a7f5722 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime, date
import json
import urllib
from bottle import request, response
import bauble.db as db
from bauble.model import Model, SystemModel
class ArgsPlugin(object):
"""
Plugin to add an args property to every request that contains the url_args for the route.
"""
name = 'arg... | 31.12766 | 93 | 0.568467 | from datetime import datetime, date
import json
import urllib
from bottle import request, response
import bauble.db as db
from bauble.model import Model, SystemModel
class ArgsPlugin(object):
"""
Plugin to add an args property to every request that contains the url_args for the route.
"""
name = 'arg... | 3,172 | 167 | 127 |
fceccd5547efa28f5062a25c096da56c380ece02 | 870 | py | Python | clusterpy/core/data/spatialLag.py | CentroGeo/clusterpy_python3 | 5c2600b048836e54495dc5997a250af72f72f6e7 | [
"BSD-3-Clause"
] | 48 | 2015-03-23T14:11:40.000Z | 2022-03-25T01:55:32.000Z | clusterpy/core/data/spatialLag.py | CentroGeo/clusterpy_python3 | 5c2600b048836e54495dc5997a250af72f72f6e7 | [
"BSD-3-Clause"
] | 8 | 2015-02-22T17:49:38.000Z | 2020-11-20T18:03:32.000Z | clusterpy/core/data/spatialLag.py | CentroGeo/clusterpy_python3 | 5c2600b048836e54495dc5997a250af72f72f6e7 | [
"BSD-3-Clause"
] | 27 | 2016-03-06T23:53:19.000Z | 2021-11-21T19:36:20.000Z | # encoding: latin1
"""spatial lag of a variable
"""
__author__ = "Juan C. Duque, Alejandro Betancourt"
__credits__ = "Copyright (c) 2010-11 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
__all__ = ['spatialLag']
import numpy
def... | 24.857143 | 58 | 0.654023 | # encoding: latin1
"""spatial lag of a variable
"""
__author__ = "Juan C. Duque, Alejandro Betancourt"
__credits__ = "Copyright (c) 2010-11 Juan C. Duque"
__license__ = "New BSD License"
__version__ = "1.0.0"
__maintainer__ = "RiSE Group"
__email__ = "contacto@rise-group.org"
__all__ = ['spatialLag']
import numpy
def... | 0 | 0 | 0 |
231f6aa566919c06850651c755c3b8c14c876a0c | 38,747 | py | Python | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | py_knots/clasper.py | Chinmaya-Kausik/py_knots | 3c9930ea0e95f6c62da9e13eb5ffcfc0e0737f9f | [
"MIT"
] | null | null | null | import tkinter as tk
from tkinter import ttk
from matplotlib.pyplot import close
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,
NavigationToolbar2Tk)
from matplotlib.mathtext import math_to_image
from io import BytesIO
from PIL import ImageTk, Image
from sympy im... | 36.901905 | 83 | 0.596666 | import tkinter as tk
from tkinter import ttk
from matplotlib.pyplot import close
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,
NavigationToolbar2Tk)
from matplotlib.mathtext import math_to_image
from io import BytesIO
from PIL import ImageTk, Image
from sympy im... | 32,757 | 20 | 867 |
baa6cb07164a988cd08cd1fa1980dc76ea0e13b8 | 1,600 | py | Python | selenium/main.py | AhmadHamze/puppeteer-typingspeed | 61b80f30fd68ade1d62429102089c071ccfdbd36 | [
"Unlicense"
] | 1 | 2022-01-17T17:06:52.000Z | 2022-01-17T17:06:52.000Z | selenium/main.py | AhmadHamze/Puppeteer-vs-Selenium | 61b80f30fd68ade1d62429102089c071ccfdbd36 | [
"Unlicense"
] | null | null | null | selenium/main.py | AhmadHamze/Puppeteer-vs-Selenium | 61b80f30fd68ade1d62429102089c071ccfdbd36 | [
"Unlicense"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.chrome.options import Options
import re
impo... | 30.769231 | 88 | 0.705625 | from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.chrome.options import Options
import re
impo... | 0 | 0 | 0 |
ed4395ec3cda55cf8f0ca11685abba932655d510 | 1,054 | py | Python | vislice.py | vitorozman/Vislice | 50fdead9426ec7edc73ccbec6caf4a661b5ecc05 | [
"MIT"
] | null | null | null | vislice.py | vitorozman/Vislice | 50fdead9426ec7edc73ccbec6caf4a661b5ecc05 | [
"MIT"
] | null | null | null | vislice.py | vitorozman/Vislice | 50fdead9426ec7edc73ccbec6caf4a661b5ecc05 | [
"MIT"
] | null | null | null | import bottle
import model
ID_IGRE_COOKIE_NAME = 'id_igre'
COOKIE_SECRET = 'my_very_special - secret key'
vislice = model.Vislice()
vislice.preberi_iz_datoteke()
@bottle.get('/')
@bottle.post('/nova_igra/')
@bottle.get('/igra/')
@bottle.post('/igra/')
bottle.run(reloader=True, debug=True)
| 22.425532 | 87 | 0.712524 | import bottle
import model
ID_IGRE_COOKIE_NAME = 'id_igre'
COOKIE_SECRET = 'my_very_special - secret key'
vislice = model.Vislice()
vislice.preberi_iz_datoteke()
@bottle.get('/')
def index():
return bottle.template('datoteke/views/index.tpl')
@bottle.post('/nova_igra/')
def nova_igra():
id_nove_igre = vis... | 663 | 0 | 88 |
780c93a71a426f40ae8aa874ef516f957142eff9 | 2,159 | py | Python | loggerBot/common/utils.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | loggerBot/common/utils.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | loggerBot/common/utils.py | mcpiroman/jarchiwum-server | e219eb0380bb4880fb83009fab21a4a1bf1a70ba | [
"MIT"
] | null | null | null | import base64
import datetime
import re
import os
def parse_irc_msg(s):
"""Breaks a message from an IRC server into its tags, prefix, command, and arguments.
"""
if not s:
raise IRCBadMessage("Empty IRC line.")
tags = {}
if s.startswith("@"):
s = s[1:]
tags_str, s = s.split... | 30.842857 | 141 | 0.621584 | import base64
import datetime
import re
import os
def print_with_time(*args):
print('[' + datetime.datetime.now().strftime("%H:%M:%S") + ']', *args)
def str_2_base64(data, encoding="utf-8"):
return str(base64.b64encode(data.encode(encoding)), encoding)
def base64_2_str(data, encoding="utf-8"):
return str... | 1,134 | 0 | 229 |
cf5855e0d2fa26f19fdee1623e58f9bf7fc17c12 | 5,662 | py | Python | run_whole.py | ilbsm/protein_stretching | 11dc9e2971111dea1185d43c7d0b978831331653 | [
"MIT"
] | null | null | null | run_whole.py | ilbsm/protein_stretching | 11dc9e2971111dea1185d43c7d0b978831331653 | [
"MIT"
] | null | null | null | run_whole.py | ilbsm/protein_stretching | 11dc9e2971111dea1185d43c7d0b978831331653 | [
"MIT"
] | null | null | null | from stretchme import Structure
from simulation_data import data_partial
from os import remove, replace
import sys
import numpy as np
directory = '/Users/pawel/PycharmProjects/Rozciaganie/data/'
proteins = {'5wyr': 248, 'trmd-no-knot': 240, 'trmd': 240, 'tm1570': 193, 'fuzja': 432}
missing = {'5wyr': 14, 'trmd-no-k... | 40.156028 | 137 | 0.517838 | from stretchme import Structure
from simulation_data import data_partial
from os import remove, replace
import sys
import numpy as np
directory = '/Users/pawel/PycharmProjects/Rozciaganie/data/'
def run_whole(name, type, residues, missing, init_means=None, method='stretch-adjusted', state='unknotted'):
name_type... | 3,524 | 0 | 46 |
8ab9d4eb4db36144d29cb23f1bbfde4f0a19987f | 387 | py | Python | oidc/migrations/0002_auto_20200813_0817.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 4 | 2020-10-08T07:36:22.000Z | 2022-02-04T12:31:31.000Z | oidc/migrations/0002_auto_20200813_0817.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 1 | 2021-04-10T08:32:42.000Z | 2021-04-10T08:32:42.000Z | oidc/migrations/0002_auto_20200813_0817.py | didx-xyz/yoma-oidc-bridge | 7e3ff6ab3ea4fed01cd7d4c113c7c3b3244356eb | [
"Apache-2.0"
] | 7 | 2021-02-10T16:04:29.000Z | 2022-03-16T08:04:48.000Z | # Generated by Django 3.1 on 2020-08-13 08:17
from django.db import migrations
| 20.368421 | 52 | 0.612403 | # Generated by Django 3.1 on 2020-08-13 08:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('oidc', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='presentationconfigurations',
old_name='verified_e... | 0 | 283 | 23 |
910608d884d58c0e1fb8126f7a9c953af61de66a | 7,422 | py | Python | tests/sqswatcher/plugins/test_slurm.py | agobeaux/aws-parallelcluster-node | 69c7cfdc00bcec923e313b7094ccc93cf73043ba | [
"Apache-2.0"
] | null | null | null | tests/sqswatcher/plugins/test_slurm.py | agobeaux/aws-parallelcluster-node | 69c7cfdc00bcec923e313b7094ccc93cf73043ba | [
"Apache-2.0"
] | null | null | null | tests/sqswatcher/plugins/test_slurm.py | agobeaux/aws-parallelcluster-node | 69c7cfdc00bcec923e313b7094ccc93cf73043ba | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 48.509804 | 119 | 0.594314 | # Copyright 2019 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file accom... | 704 | 0 | 66 |
f0974d0eface887a465b1275e0fa0106bf840f7f | 6,933 | py | Python | vector.py | KarlXiao/LinearAlgebraLib | 4ed501e0919346c38a337c820a86bf6d5466b343 | [
"MIT"
] | 2 | 2017-08-30T03:10:38.000Z | 2017-11-02T03:42:40.000Z | vector.py | KarlXiao/LinearAlgebraLib | 4ed501e0919346c38a337c820a86bf6d5466b343 | [
"MIT"
] | null | null | null | vector.py | KarlXiao/LinearAlgebraLib | 4ed501e0919346c38a337c820a86bf6d5466b343 | [
"MIT"
] | null | null | null | import math
from decimal import Decimal, getcontext
getcontext().prec = 30
if __name__ == '__main__':
v1 = Vector([8.218, -9.341])
v2 = Vector([-1.129, 2.111])
print('Add:', v1 + v2)
v3 = Vector([7.119, 8.215])
v4 = Vector([-8.223, 0.878])
print('Minus:', v3 - v4)
v5 = Vector([1.671, -1.... | 35.372449 | 131 | 0.586759 | import math
from decimal import Decimal, getcontext
getcontext().prec = 30
class Vector(object):
def __init__(self, coordinates):
try:
if not coordinates:
raise ValueError
self.coordinates = tuple([Decimal(x) for x in coordinates])
self.dimension = len(... | 819 | 4,552 | 23 |
9b28579ed2f019eeaf832804362e7505d12f0adf | 854 | py | Python | latex_typesetter.py | RavidHausmann/Rabbits_Lab | 633ac4150f8760ddaac4c1f519ecd2973458a7dc | [
"MIT"
] | null | null | null | latex_typesetter.py | RavidHausmann/Rabbits_Lab | 633ac4150f8760ddaac4c1f519ecd2973458a7dc | [
"MIT"
] | null | null | null | latex_typesetter.py | RavidHausmann/Rabbits_Lab | 633ac4150f8760ddaac4c1f519ecd2973458a7dc | [
"MIT"
] | null | null | null | BinaryOperators = {'/' : lambda a, b: '\\frac{' + a + '}{' + b + '}'}
UnaryOperators = {'sqrt' : lambda a: '\\sqrt{'+ a + '}'}
read(set('2 / 4 * 3'))
| 23.722222 | 71 | 0.460187 | BinaryOperators = {'/' : lambda a, b: '\\frac{' + a + '}{' + b + '}'}
UnaryOperators = {'sqrt' : lambda a: '\\sqrt{'+ a + '}'}
def set(equation):
Output = []
terms = equation.split(" ")
i = 0
while i < len(terms):
term = terms[i]
if term == '*':
Output.append('\\cdot')
... | 655 | 0 | 46 |
dc66153262451fdaf6fe9ef15eb90b279d3d4604 | 7,918 | py | Python | lp/parser.py | wr1/lamprop | b1f290f38ae55a3d45e54906cae609e2d0c32374 | [
"BSD-2-Clause"
] | null | null | null | lp/parser.py | wr1/lamprop | b1f290f38ae55a3d45e54906cae609e2d0c32374 | [
"BSD-2-Clause"
] | null | null | null | lp/parser.py | wr1/lamprop | b1f290f38ae55a3d45e54906cae609e2d0c32374 | [
"BSD-2-Clause"
] | null | null | null | # file: parser.py
# vim:fileencoding=utf-8:ft=python
# Copyright © 2014-2021 R.F. Smith <rsmith@xs4all.nl>. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause
# Created: 2014-02-21 21:35:41 +0100
# Last modified: 2022-01-21T17:09:55+0100
"""Parser for lamprop files."""
import copy
import logging
from .core i... | 31.545817 | 81 | 0.58045 | # file: parser.py
# vim:fileencoding=utf-8:ft=python
# Copyright © 2014-2021 R.F. Smith <rsmith@xs4all.nl>. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause
# Created: 2014-02-21 21:35:41 +0100
# Last modified: 2022-01-21T17:09:55+0100
"""Parser for lamprop files."""
import copy
import logging
from .core i... | 0 | 0 | 0 |
9176738ab69ce0a2f9107afadb02878e8973a6c7 | 9,912 | py | Python | instruction.py | rosshays/mips-simulation | 1d734c8a368c57ba46b7d45e64ccc3b3da75058c | [
"MIT"
] | null | null | null | instruction.py | rosshays/mips-simulation | 1d734c8a368c57ba46b7d45e64ccc3b3da75058c | [
"MIT"
] | null | null | null | instruction.py | rosshays/mips-simulation | 1d734c8a368c57ba46b7d45e64ccc3b3da75058c | [
"MIT"
] | null | null | null | import conversion as conv
| 32.821192 | 83 | 0.669391 | import conversion as conv
class Instruction:
SIZE = 4
def __init__(self, program, line, line_number):
self.program = program
self.line = line
self.line_number = line_number # used for highlighting later on
tokens = line.split("#")[0].split()
tokens = [i.split(",")[0] for i in tokens]
i = 0
labels = ... | 9,737 | 126 | 23 |
d7180703973db004d564143ff5d94f48e6036b75 | 9,183 | py | Python | romp/base.py | jjandnn/ROMP | 653a0c9de13c7e242bc304147ae6559d1c6ff283 | [
"MIT"
] | 2 | 2022-03-28T07:22:01.000Z | 2022-03-28T07:22:05.000Z | romp/base.py | qumengxue/ROMP | 1b1c37322f7096da5f544b11a1e1c1c13bf6a259 | [
"MIT"
] | 6 | 2022-02-11T01:07:39.000Z | 2022-02-11T06:20:45.000Z | romp/base.py | qumengxue/ROMP | 1b1c37322f7096da5f544b11a1e1c1c13bf6a259 | [
"MIT"
] | null | null | null | import sys, os, cv2
import numpy as np
import time, datetime
import logging
import copy, random, itertools
from prettytable import PrettyTable
import pickle
import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import Dataset, DataLoader, ConcatDataset
import config... | 54.337278 | 173 | 0.677339 | import sys, os, cv2
import numpy as np
import time, datetime
import logging
import copy, random, itertools
from prettytable import PrettyTable
import pickle
import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import Dataset, DataLoader, ConcatDataset
import config... | 7,822 | -2 | 292 |
2a720e7f5e53ae0b1f9c471339f6d93822b32c83 | 3,026 | py | Python | tests/test_cards/test_actions/test_vassal.py | evanofslack/pyminion | 0d0bfc6d8e84e9f33e617c7d01b6edb649166290 | [
"MIT"
] | 5 | 2021-12-17T20:34:55.000Z | 2022-01-24T15:18:05.000Z | tests/test_cards/test_actions/test_vassal.py | evanofslack/pyminion | 0d0bfc6d8e84e9f33e617c7d01b6edb649166290 | [
"MIT"
] | 31 | 2021-10-29T21:05:00.000Z | 2022-03-22T03:27:14.000Z | tests/test_cards/test_actions/test_vassal.py | evanofslack/pyminion | 0d0bfc6d8e84e9f33e617c7d01b6edb649166290 | [
"MIT"
] | 1 | 2021-12-23T18:32:47.000Z | 2021-12-23T18:32:47.000Z | from pyminion.expansions.base import estate, smithy, vassal, village
from pyminion.game import Game
from pyminion.players import Human
| 29.378641 | 74 | 0.684071 | from pyminion.expansions.base import estate, smithy, vassal, village
from pyminion.game import Game
from pyminion.players import Human
def test_vassal_not_action_play(human: Human, game: Game):
human.hand.add(vassal)
human.hand.cards[0].play(human, game)
assert len(human.hand) == 0
assert len(human.p... | 2,723 | 0 | 161 |
3dd94b5ebcd6b6a3092792d00b4e83a04197f14d | 531 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler003_largest_prime_factor.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler003_largest_prime_factor.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler003_largest_prime_factor.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | #!/usr/bin/env python
"""
Solution to Project Euler Problem 3
http://projecteuler.net/
by Apalala <apalala@gmail.com>
(cc) Attribution-ShareAlike
http://creativecommons.org/licenses/by-sa/3.0/
Find the largest prime factor of the given number
"""
from factorization import factors
TARGET = 600851475143
if __na... | 15.617647 | 49 | 0.715631 | #!/usr/bin/env python
"""
Solution to Project Euler Problem 3
http://projecteuler.net/
by Apalala <apalala@gmail.com>
(cc) Attribution-ShareAlike
http://creativecommons.org/licenses/by-sa/3.0/
Find the largest prime factor of the given number
"""
from factorization import factors
TARGET = 600851475143
def larges... | 101 | 0 | 69 |
e337add0b89fbcf50b511f777109fc7d8bd70129 | 636 | py | Python | drivers/fan.py | DanielCasner/farmtomation | 9838f6e56c4839d47fd9d32fe245a08ec42762b9 | [
"MIT"
] | 1 | 2018-02-15T20:24:34.000Z | 2018-02-15T20:24:34.000Z | drivers/fan.py | DanielCasner/coop | 9838f6e56c4839d47fd9d32fe245a08ec42762b9 | [
"MIT"
] | null | null | null | drivers/fan.py | DanielCasner/coop | 9838f6e56c4839d47fd9d32fe245a08ec42762b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Classes for PWMing fans
"""
__author__ = "<Daniel Casner <www.danielcasner.org>"
def DiscreteFan(object):
"A simple fan controller with discrete PWM speeds"
def __init__(self, pi, gpio, speeds=(0, 4095), phase=0):
"Setup the fan"
self.pi = pi
self.gpio = gpio... | 26.5 | 82 | 0.63522 | #!/usr/bin/env python3
"""
Classes for PWMing fans
"""
__author__ = "<Daniel Casner <www.danielcasner.org>"
def DiscreteFan(object):
"A simple fan controller with discrete PWM speeds"
def __init__(self, pi, gpio, speeds=(0, 4095), phase=0):
"Setup the fan"
self.pi = pi
self.gpio = gpio... | 45 | 0 | 27 |
778193a56cc7e639a2c9502e12273c8bd90719b2 | 4,157 | py | Python | DS_ETL/bin/py2/FileCompressor.py | joonwoo8395/joonwoo | b84a7881a87424bd1557bf83c7a71da295b83ecb | [
"MIT"
] | null | null | null | DS_ETL/bin/py2/FileCompressor.py | joonwoo8395/joonwoo | b84a7881a87424bd1557bf83c7a71da295b83ecb | [
"MIT"
] | null | null | null | DS_ETL/bin/py2/FileCompressor.py | joonwoo8395/joonwoo | b84a7881a87424bd1557bf83c7a71da295b83ecb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
import glob
import time
import zipfile
import signal
import ConfigParser
import Mobigen.Common.Log as Log; Log.Init()
SHUTDOWN = False
signal.signal(signal.SIGTERM, handler)
signal.signal(signal.SIGINT , handler)
signal.signal(signal.SIGHUP... | 23.094444 | 98 | 0.689439 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
import os
import sys
import glob
import time
import zipfile
import signal
import ConfigParser
import Mobigen.Common.Log as Log; Log.Init()
SHUTDOWN = False
def handler(signum, frame) :
global SHUTDOWN
SHUTDOWN = True
__LOG__.Trace("Catch Signal = %s" % sign... | 3,249 | 3 | 285 |
57c4d78210d0c2ac7ffe253ae4cea4e033feb535 | 1,150 | py | Python | setup.py | yamins81/simffa | 755e3fb3f8a09781b1d6011e5cc5472e84a29f85 | [
"MIT"
] | 1 | 2018-05-07T16:38:33.000Z | 2018-05-07T16:38:33.000Z | setup.py | yamins81/simffa | 755e3fb3f8a09781b1d6011e5cc5472e84a29f85 | [
"MIT"
] | null | null | null | setup.py | yamins81/simffa | 755e3fb3f8a09781b1d6011e5cc5472e84a29f85 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" distribute- and pip-enabled setup.py for simffa """
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
setup(
name='simffa',
version='dev',
include_package_data=True,
install_requires=parse_requi... | 23.469388 | 77 | 0.611304 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" distribute- and pip-enabled setup.py for simffa """
from distribute_setup import use_setuptools
use_setuptools()
from setuptools import setup
import re
def parse_requirements(file_name):
requirements = []
for line in open(file_name, 'r').read().split('\n'):... | 654 | 0 | 46 |
29a7ce83d2bac71884d75e3f9fdf3674225abe4a | 840 | py | Python | graph_from_hist.py | r-kapoor/dig-network | 1e17132140d28cc1e302d4749833700c86927c9b | [
"MIT"
] | null | null | null | graph_from_hist.py | r-kapoor/dig-network | 1e17132140d28cc1e302d4749833700c86927c9b | [
"MIT"
] | null | null | null | graph_from_hist.py | r-kapoor/dig-network | 1e17132140d28cc1e302d4749833700c86927c9b | [
"MIT"
] | null | null | null | import networkx as nx
import codecs
import json
import pickle
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from string import ascii_lowercase
histogram = None
for char in ['a', 'b', 'c', 'd']:
for c in ascii_lowercase:
filename = "hist"+char+c
print("R... | 25.454545 | 55 | 0.577381 | import networkx as nx
import codecs
import json
import pickle
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from string import ascii_lowercase
histogram = None
for char in ['a', 'b', 'c', 'd']:
for c in ascii_lowercase:
filename = "hist"+char+c
print("R... | 0 | 0 | 0 |
dd8e4d2deca8bfa823a5795d012383e5ddc56a2d | 528 | py | Python | api_studentdb/studentdb/api/urls.py | ydang5/week-10-assignment | f04e13541d271db1c90561def79b98162856b54d | [
"BSD-3-Clause"
] | null | null | null | api_studentdb/studentdb/api/urls.py | ydang5/week-10-assignment | f04e13541d271db1c90561def79b98162856b54d | [
"BSD-3-Clause"
] | null | null | null | api_studentdb/studentdb/api/urls.py | ydang5/week-10-assignment | f04e13541d271db1c90561def79b98162856b54d | [
"BSD-3-Clause"
] | null | null | null | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from api import views
urlpatterns = [
path('studentdb',views.StudentDbDetail.as_view()),
path('add',views.AddStudentAPIView.as_view()),
path('studentdetail/<student_number>',views.GetStudentAPIView.as_view()),
pa... | 37.714286 | 80 | 0.785985 | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from api import views
urlpatterns = [
path('studentdb',views.StudentDbDetail.as_view()),
path('add',views.AddStudentAPIView.as_view()),
path('studentdetail/<student_number>',views.GetStudentAPIView.as_view()),
pa... | 0 | 0 | 0 |
c5f0b3d3fb2e5251ef2db0a04f75b3a072d2e2d4 | 766 | py | Python | api/migrations/0002_auto_20201218_0343.py | AmbiteamProject/spleeter-web | e93c5a719a23d7f22e8390ddba7b368b45fef415 | [
"MIT"
] | 202 | 2020-05-10T02:50:11.000Z | 2022-03-25T00:34:01.000Z | api/migrations/0002_auto_20201218_0343.py | AmbiteamProject/spleeter-web | e93c5a719a23d7f22e8390ddba7b368b45fef415 | [
"MIT"
] | 76 | 2020-06-12T10:28:30.000Z | 2022-03-25T20:10:01.000Z | api/migrations/0002_auto_20201218_0343.py | AmbiteamProject/spleeter-web | e93c5a719a23d7f22e8390ddba7b368b45fef415 | [
"MIT"
] | 57 | 2020-05-18T01:20:50.000Z | 2022-03-21T10:34:23.000Z | # Generated by Django 3.1.2 on 2020-12-18 03:43
from django.db import migrations, models
| 26.413793 | 72 | 0.578329 | # Generated by Django 3.1.2 on 2020-12-18 03:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='dynamicmix',
name='celery_id',
... | 0 | 652 | 23 |
2c01bf2690350f9bc4c70417bba77caa47671bb4 | 1,671 | py | Python | snpdb/genome/fasta_index.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | snpdb/genome/fasta_index.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | snpdb/genome/fasta_index.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | import logging
import pandas as pd
from library.file_utils import file_md5sum
| 40.756098 | 120 | 0.663674 | import logging
import pandas as pd
from library.file_utils import file_md5sum
def load_genome_fasta_index(genome_fasta: 'GenomeFasta', genome_build: 'GenomeBuild'):
# Delete any older GenomeFasta entries for this build/annotation consortium (eg before we changed settings)
gf_qs = genome_build.genomefasta_se... | 1,567 | 0 | 23 |
5d7bfde9ce3b4a8f0f86e809709fffd08d3b7096 | 2,561 | py | Python | loadbalancer/userdao.py | angelbarrera92/simple-python-load-balancer | d17c3a9ef7fb9b2400e9a547143ec9a240699d5e | [
"MIT"
] | 1 | 2020-04-10T19:22:27.000Z | 2020-04-10T19:22:27.000Z | loadbalancer/userdao.py | angelbarrera92/simple-python-load-balancer | d17c3a9ef7fb9b2400e9a547143ec9a240699d5e | [
"MIT"
] | null | null | null | loadbalancer/userdao.py | angelbarrera92/simple-python-load-balancer | d17c3a9ef7fb9b2400e9a547143ec9a240699d5e | [
"MIT"
] | null | null | null | import hashlib
import uuid
import appserversdao
import constants
from pymongo import MongoClient
mongo = MongoClient(constants.MONGO_URI)
mongodb = mongo[constants.MONGO_DATABASE]
mongocollection = mongodb[constants.MONGO_USERS_COLLECTION]
users = list()
| 27.244681 | 93 | 0.63647 | import hashlib
import uuid
import appserversdao
import constants
from pymongo import MongoClient
mongo = MongoClient(constants.MONGO_URI)
mongodb = mongo[constants.MONGO_DATABASE]
mongocollection = mongodb[constants.MONGO_USERS_COLLECTION]
users = list()
class User(object):
def __init__(self, email, password):
... | 1,948 | 213 | 138 |
b71f40f444f3973212f729e31655c0fb4fb96687 | 1,668 | py | Python | tests/conftest.py | saurabhshubham323/PDPbox | b39a126715e68985731dec9b0a6069176d2139f6 | [
"MIT"
] | 1 | 2018-07-10T06:30:07.000Z | 2018-07-10T06:30:07.000Z | tests/conftest.py | saurabhshubham323/PDPbox | b39a126715e68985731dec9b0a6069176d2139f6 | [
"MIT"
] | null | null | null | tests/conftest.py | saurabhshubham323/PDPbox | b39a126715e68985731dec9b0a6069176d2139f6 | [
"MIT"
] | null | null | null |
import pytest
import joblib
from pathlib import Path
@pytest.fixture(scope='session')
@pytest.fixture(scope='module')
@pytest.fixture(scope='module')
@pytest.fixture(scope='module')
@pytest.fixture(scope='module')
@pytest.fixture(scope='session')
@pytest.fixture(scope='module')
@pytest.fixture(scope='m... | 19.623529 | 65 | 0.70024 |
import pytest
import joblib
from pathlib import Path
@pytest.fixture(scope='session')
def titanic():
root_path = Path(__file__).resolve().parents[1]
file = root_path / 'pdpbox' / 'datasets' / 'test_titanic.pkl'
return joblib.load(file)
@pytest.fixture(scope='module')
def titanic_data(titanic):
retu... | 772 | 0 | 330 |
bd1d74e5ac367e134c8e0a19a4b10cfe4ee5fb88 | 15,704 | py | Python | main.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | 7 | 2020-11-10T07:33:40.000Z | 2021-06-23T07:25:43.000Z | main.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | null | null | null | main.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | 5 | 2020-07-12T00:10:59.000Z | 2021-06-22T09:13:13.000Z | import sys, os
# sys.path.append(os.path.join(os.path.dirname(__file__)) #TODO: Is this a good idea? Dunno! It works!
# print(os.path.join(os.path.dirname(__file__)))
import argparse
import markov_pilot.environment.properties as prp
from markov_pilot.environment.environment import NoFGJsbSimEnv_multi, J... | 59.037594 | 219 | 0.707972 | import sys, os
# sys.path.append(os.path.join(os.path.dirname(__file__)) #TODO: Is this a good idea? Dunno! It works!
# print(os.path.join(os.path.dirname(__file__)))
import argparse
import markov_pilot.environment.properties as prp
from markov_pilot.environment.environment import NoFGJsbSimEnv_multi, J... | 11,808 | 0 | 69 |
47df491f83f28f38edee27fab4f1ed8807524b53 | 1,917 | py | Python | parser.py | nikitinivan/appfollow | 1e75edb295c4f32e351ba19c40324b49a2e77521 | [
"MIT"
] | null | null | null | parser.py | nikitinivan/appfollow | 1e75edb295c4f32e351ba19c40324b49a2e77521 | [
"MIT"
] | null | null | null | parser.py | nikitinivan/appfollow | 1e75edb295c4f32e351ba19c40324b49a2e77521 | [
"MIT"
] | null | null | null | from selenium import webdriver
import time
import os
from urllib.parse import urlparse, parse_qs
from pprint import pprint
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# EXECUTABLE PATH FOR PHANTOMJS(HEADLESS BROWSER)
EXE_PHANTOM = os.path.join(BASE_DIR, 'webdrivers/phantomjs')
def get_params(url):
"""... | 30.919355 | 123 | 0.665623 | from selenium import webdriver
import time
import os
from urllib.parse import urlparse, parse_qs
from pprint import pprint
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# EXECUTABLE PATH FOR PHANTOMJS(HEADLESS BROWSER)
EXE_PHANTOM = os.path.join(BASE_DIR, 'webdrivers/phantomjs')
def get_params(url):
"""... | 0 | 0 | 0 |
5eb6e5430bf7c878c9fc0a7769b0a39566ff41fd | 3,464 | py | Python | biswebpython/modules/temporalImageDistanceMatrix.py | leej3/bisweb | 0c08a9cd78d228542a64527d2ad74c1f6f7d0a2b | [
"Apache-2.0"
] | 66 | 2018-04-28T22:09:00.000Z | 2022-03-07T00:28:14.000Z | biswebpython/modules/temporalImageDistanceMatrix.py | leej3/bisweb | 0c08a9cd78d228542a64527d2ad74c1f6f7d0a2b | [
"Apache-2.0"
] | 28 | 2018-08-17T13:57:46.000Z | 2021-11-24T13:20:35.000Z | biswebpython/modules/temporalImageDistanceMatrix.py | leej3/bisweb | 0c08a9cd78d228542a64527d2ad74c1f6f7d0a2b | [
"Apache-2.0"
] | 24 | 2018-05-09T20:14:00.000Z | 2022-03-21T12:54:22.000Z | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... | 39.363636 | 163 | 0.536952 | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... | 2,325 | 40 | 107 |
e61816c99ecd0efba02759f7715f26354c387b46 | 3,516 | py | Python | insight.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | null | null | null | insight.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | null | null | null | insight.py | alvin-c/fbmessenger-visualizer | f89988720b2af79832a60824dce969f20b0ebb59 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from yaml import load, dump
from collections import OrderedDict
import time, os
from visualize import visualize
DIV = '\n'+ '='*64 + '\n'
start_time = time.time()
# Iterate over all conversation threads
# Generates insight data on a single conversation thread
# Execute one at a time in o... | 23.918367 | 89 | 0.6843 | #!/usr/bin/env python
from yaml import load, dump
from collections import OrderedDict
import time, os
from visualize import visualize
DIV = '\n'+ '='*64 + '\n'
start_time = time.time()
def usage():
pass
# Iterate over all conversation threads
def summarize():
print 'Opening file... ',
file = open('messages_... | 3,051 | 0 | 90 |
4b4d1da03767a4d72b7d14fb78cf5621889cec45 | 1,073 | py | Python | BanHammer/blacklist/views/setting.py | mozilla/BanHammer | 0ed600c8d57c26e55df70b8b5edb9aba7c8f8749 | [
"BSD-3-Clause"
] | 4 | 2017-09-12T03:07:06.000Z | 2018-08-10T17:53:45.000Z | BanHammer/blacklist/views/setting.py | mozilla/BanHammer | 0ed600c8d57c26e55df70b8b5edb9aba7c8f8749 | [
"BSD-3-Clause"
] | null | null | null | BanHammer/blacklist/views/setting.py | mozilla/BanHammer | 0ed600c8d57c26e55df70b8b5edb9aba7c8f8749 | [
"BSD-3-Clause"
] | 1 | 2019-11-03T00:04:03.000Z | 2019-11-03T00:04:03.000Z | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from session_csrf import anonymous_csrf
from ..models import Config
from ..forms import SettingsForm
@anonymous_cs... | 30.657143 | 77 | 0.639329 | from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from session_csrf import anonymous_csrf
from ..models import Config
from ..forms import SettingsForm
@anonymous_cs... | 728 | 0 | 22 |
e5cf5ca35acc0abfa9f35ba1ae17d75cf0109e56 | 11,719 | py | Python | rasa_sdk/forms.py | maggo/rasa-sdk | 7dcb531739a9cf105e2a7d2bb003f4b39ef6481e | [
"Apache-2.0"
] | null | null | null | rasa_sdk/forms.py | maggo/rasa-sdk | 7dcb531739a9cf105e2a7d2bb003f4b39ef6481e | [
"Apache-2.0"
] | null | null | null | rasa_sdk/forms.py | maggo/rasa-sdk | 7dcb531739a9cf105e2a7d2bb003f4b39ef6481e | [
"Apache-2.0"
] | null | null | null | import logging
import typing
import warnings
from typing import Dict, Text, Any, List, Optional
from abc import ABC
from rasa_sdk import utils
from rasa_sdk.events import SlotSet, EventType
from rasa_sdk.interfaces import Action
logger = logging.getLogger(__name__)
if typing.TYPE_CHECKING: # pragma: no cover
fr... | 34.569322 | 87 | 0.609182 | import logging
import typing
import warnings
from typing import Dict, Text, Any, List, Optional
from abc import ABC
from rasa_sdk import utils
from rasa_sdk.events import SlotSet, EventType
from rasa_sdk.interfaces import Action
logger = logging.getLogger(__name__)
if typing.TYPE_CHECKING: # pragma: no cover
fr... | 2,684 | 0 | 107 |
c0243c34b356b22e1a615ce6e61857e2ede8fc51 | 4,544 | py | Python | tracking.py | sidharthramesh98/MessySchmidt | c530db6bb0a86c73629d84b8433f1cce072c5911 | [
"Apache-2.0"
] | null | null | null | tracking.py | sidharthramesh98/MessySchmidt | c530db6bb0a86c73629d84b8433f1cce072c5911 | [
"Apache-2.0"
] | null | null | null | tracking.py | sidharthramesh98/MessySchmidt | c530db6bb0a86c73629d84b8433f1cce072c5911 | [
"Apache-2.0"
] | 1 | 2018-07-25T08:35:24.000Z | 2018-07-25T08:35:24.000Z | import cv2
import numpy as np
from utils import detector_utils
import tensorflow as tf
import sys
import cv2
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
detection_graph, sess = detector_utils.load_inference_graph()
sess = tf.Session(graph=detection_graph)
width = 680
height = 440
flago = Fals... | 29.128205 | 165 | 0.614217 | import cv2
import numpy as np
from utils import detector_utils
import tensorflow as tf
import sys
import cv2
(major_ver, minor_ver, subminor_ver) = (cv2.__version__).split('.')
detection_graph, sess = detector_utils.load_inference_graph()
sess = tf.Session(graph=detection_graph)
width = 680
height = 440
flago = Fals... | 566 | 0 | 27 |
094a71665014ad4baca4f3460ff494a0c260518d | 402 | py | Python | Week 4 - Python for Data Science/Pandas_Describing Data_exercise.py | baranitharan2020/PGDDS | 72aa4bd450ec2f0bc531bc6400ccd5dd4fdd55be | [
"CC0-1.0"
] | null | null | null | Week 4 - Python for Data Science/Pandas_Describing Data_exercise.py | baranitharan2020/PGDDS | 72aa4bd450ec2f0bc531bc6400ccd5dd4fdd55be | [
"CC0-1.0"
] | null | null | null | Week 4 - Python for Data Science/Pandas_Describing Data_exercise.py | baranitharan2020/PGDDS | 72aa4bd450ec2f0bc531bc6400ccd5dd4fdd55be | [
"CC0-1.0"
] | null | null | null | import numpy as np
import pandas as pd
# The file is stored at the following path:
# 'https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv'
df = pd.read_csv('https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv')
df.set_index(['Office','Department'],inpla... | 36.545455 | 104 | 0.78607 | import numpy as np
import pandas as pd
# The file is stored at the following path:
# 'https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv'
df = pd.read_csv('https://media-doselect.s3.amazonaws.com/generic/NMgEjwkAEGGQZBoNYGr9Ld7w0/rating.csv')
df.set_index(['Office','Department'],inpla... | 0 | 0 | 0 |
a6f7e698dc12612444a097def6e75ece0525c3fd | 929 | py | Python | test/TestDashboards.py | box/wavectl | 629ca9b25da55a41f391d259bffd8ea3a57eb618 | [
"Apache-2.0"
] | 18 | 2018-06-08T16:42:57.000Z | 2021-07-30T06:37:46.000Z | test/TestDashboards.py | box/wavectl | 629ca9b25da55a41f391d259bffd8ea3a57eb618 | [
"Apache-2.0"
] | 20 | 2018-06-09T06:02:34.000Z | 2019-12-02T18:49:42.000Z | test/TestDashboards.py | box/wavectl | 629ca9b25da55a41f391d259bffd8ea3a57eb618 | [
"Apache-2.0"
] | 12 | 2018-06-08T16:42:59.000Z | 2022-03-01T09:50:34.000Z | #!/usr/bin/env python
# Alert state used for tests.
from __future__ import absolute_import
from __future__ import print_function
import json
import TestRsrcs
class Dashboard(TestRsrcs.Rsrc):
""" A class that encompasses some dashboard data used for tests """
kubeBoxPkiNameMatchString = "SomeNameToBeMache... | 28.151515 | 71 | 0.696448 | #!/usr/bin/env python
# Alert state used for tests.
from __future__ import absolute_import
from __future__ import print_function
import json
import TestRsrcs
class Dashboard(TestRsrcs.Rsrc):
""" A class that encompasses some dashboard data used for tests """
kubeBoxPkiNameMatchString = "SomeNameToBeMache... | 493 | 0 | 26 |
a6e4db0049f4d267eb8df5f62f486ab858c2c6f6 | 5,914 | py | Python | train_normal_vae.py | altosaar/gamma-variational-autoencoder | 879690e197ba6644157b65273db685cbe48392fb | [
"MIT"
] | 10 | 2018-05-09T13:27:49.000Z | 2021-08-13T02:15:02.000Z | train_normal_vae.py | altosaar/gamma-variational-autoencoder | 879690e197ba6644157b65273db685cbe48392fb | [
"MIT"
] | null | null | null | train_normal_vae.py | altosaar/gamma-variational-autoencoder | 879690e197ba6644157b65273db685cbe48392fb | [
"MIT"
] | 2 | 2018-07-05T21:15:55.000Z | 2020-06-20T06:13:57.000Z | import pathlib
import time
import scipy.misc
from mxnet import nd
import mxnet as mx
import h5py
import numpy as np
from mxnet import gluon
class BernoulliLogLik(gluon.HybridBlock):
"""Calculate log probability of a Bernoulli."""
def hybrid_forward(self, F, x, logits):
"""Bernoulli log prob is
x * log... | 32.494505 | 87 | 0.630876 | import pathlib
import time
import scipy.misc
from mxnet import nd
import mxnet as mx
import h5py
import numpy as np
from mxnet import gluon
class DeepLatentGaussianModel(gluon.HybridBlock):
def __init__(self):
super().__init__()
with self.name_scope():
self.log_prior = GaussianLogProb()
# genera... | 2,927 | 105 | 437 |
7eccb5155ea4744da74a788b3ba2208b9d9a7627 | 6,600 | py | Python | dsn/s_expr/clef_address.py | expressionsofchange/nerf1 | 13ec152be5831eb5db4a8385afcd55435f2ada49 | [
"MIT"
] | 5 | 2018-05-17T16:57:12.000Z | 2021-09-14T00:53:48.000Z | dsn/s_expr/clef_address.py | expressionsofchange/nerf1 | 13ec152be5831eb5db4a8385afcd55435f2ada49 | [
"MIT"
] | null | null | null | dsn/s_expr/clef_address.py | expressionsofchange/nerf1 | 13ec152be5831eb5db4a8385afcd55435f2ada49 | [
"MIT"
] | null | null | null | """
This module contains machinery to annotate Notes with a "global address", the path of that note in a with respect to
some global root score.
Note: the annotated Notes are defined here with considerable amount of duplication with clef.py, most notably in the
fact that we define a separate subclass for each note cla... | 36.263736 | 119 | 0.688182 | """
This module contains machinery to annotate Notes with a "global address", the path of that note in a with respect to
some global root score.
Note: the annotated Notes are defined here with considerable amount of duplication with clef.py, most notably in the
fact that we define a separate subclass for each note cla... | 2,730 | 44 | 532 |
e55637961b72ac2b2918945e4ac9403b5f28ae9c | 545 | py | Python | jutils/image/gifer.py | jaymody/jutils | 165d47f0cf1a2a91a952d361ad8d494a7868fd35 | [
"MIT"
] | null | null | null | jutils/image/gifer.py | jaymody/jutils | 165d47f0cf1a2a91a952d361ad8d494a7868fd35 | [
"MIT"
] | null | null | null | jutils/image/gifer.py | jaymody/jutils | 165d47f0cf1a2a91a952d361ad8d494a7868fd35 | [
"MIT"
] | null | null | null | # Imports
import re
import os
import glob
import imageio
def gifer(glob_pattern, out_fpath):
"""Converts a series of images into a gif in order of numerical numbers in their name"""
try:
paths = glob.glob(glob_pattern)
paths = list(sorted(paths, \
key=lambda x: int(re.sub('[^0-9]','... | 28.684211 | 92 | 0.640367 | # Imports
import re
import os
import glob
import imageio
def gifer(glob_pattern, out_fpath):
"""Converts a series of images into a gif in order of numerical numbers in their name"""
try:
paths = glob.glob(glob_pattern)
paths = list(sorted(paths, \
key=lambda x: int(re.sub('[^0-9]','... | 0 | 0 | 0 |
fb3fa93bb4c0b719b976d0b088376bc957ce0d8d | 2,813 | py | Python | lib/panel.py | Taremin/TareminMeshCombiner | ddcd203fa67ccf161b1f93234bf2c26a81eb2b67 | [
"MIT"
] | 3 | 2021-06-26T16:34:16.000Z | 2021-06-29T12:45:52.000Z | lib/panel.py | Taremin/TareminMeshCombiner | ddcd203fa67ccf161b1f93234bf2c26a81eb2b67 | [
"MIT"
] | null | null | null | lib/panel.py | Taremin/TareminMeshCombiner | ddcd203fa67ccf161b1f93234bf2c26a81eb2b67 | [
"MIT"
] | null | null | null | import bpy
from . import combine_mesh, group_settings, util
| 31.606742 | 97 | 0.53395 | import bpy
from . import combine_mesh, group_settings, util
class TAREMIN_MESH_COMBINER_PT_Panel(bpy.types.Panel):
bl_label = 'Taremin Mesh Combiner'
bl_region_type = "UI"
bl_space_type = 'VIEW_3D'
bl_category = 'Taremin'
def draw(self, context):
props = util.get_settings(conte... | 2,663 | 190 | 24 |
4152dab8df03f0403541578a786a284c7e00000a | 2,045 | py | Python | python/cendalytics/tfidf/core/dmo/inversion_library_loader.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/tfidf/core/dmo/inversion_library_loader.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | python/cendalytics/tfidf/core/dmo/inversion_library_loader.py | jiportilla/ontology | 8a66bb7f76f805c64fc76cfc40ab7dfbc1146f40 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import time
import pandas as pd
from pandas import DataFrame
from base import BaseObject
from base import FileIO
class InversionLibraryLoader(BaseObject):
""" Load Inversion Library """
__df_inversion = None
__header_row = ["Id",
... | 25.246914 | 80 | 0.539853 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import time
import pandas as pd
from pandas import DataFrame
from base import BaseObject
from base import FileIO
class InversionLibraryLoader(BaseObject):
""" Load Inversion Library """
__df_inversion = None
__header_row = ["Id",
... | 1,174 | 0 | 81 |
77217fccd66a66a5eb28813fa9e5c0bac207d3f9 | 325 | py | Python | django_postges_lookups_any/test_utils/test_app/models.py | alexshin/django-postges-lookups-any | 4b58813d70b11ff7fe8084b04b2da3d1e8675708 | [
"MIT"
] | 2 | 2021-02-09T07:17:16.000Z | 2021-02-24T04:18:36.000Z | django_postges_lookups_any/test_utils/test_app/models.py | alexshin/django-postges-lookups-any | 4b58813d70b11ff7fe8084b04b2da3d1e8675708 | [
"MIT"
] | null | null | null | django_postges_lookups_any/test_utils/test_app/models.py | alexshin/django-postges-lookups-any | 4b58813d70b11ff7fe8084b04b2da3d1e8675708 | [
"MIT"
] | null | null | null | from django.db import models
| 27.083333 | 58 | 0.732308 | from django.db import models
class ModelA(models.Model):
name = models.CharField('Test Name A', max_length=100)
external_id = models.PositiveIntegerField('Test ID A')
class ModelB(models.Model):
name = models.CharField('Test Name B', max_length=100)
external_id = models.PositiveIntegerField('Test ID... | 0 | 248 | 46 |
2844cf610671e8110c55ad133824c9e511e119c8 | 26,633 | py | Python | manage.py | andrewimeson/hyperglass | da30c4ca68f10830708b75984f37728c06664f83 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-06-18T07:25:42.000Z | 2019-06-18T07:25:42.000Z | manage.py | fulopa7/hyperglass | da30c4ca68f10830708b75984f37728c06664f83 | [
"BSD-3-Clause-Clear"
] | null | null | null | manage.py | fulopa7/hyperglass | da30c4ca68f10830708b75984f37728c06664f83 | [
"BSD-3-Clause-Clear"
] | null | null | null | #!/usr/bin/env python3
# Standard Imports
import os
import grp
import pwd
import sys
import glob
import random
import shutil
import string
# Module Imports
import click
import json
from passlib.hash import pbkdf2_sha256
import requests
# Initialize shutil copy function
cp = shutil.copyfile
# Define working director... | 39.05132 | 134 | 0.616491 | #!/usr/bin/env python3
# Standard Imports
import os
import grp
import pwd
import sys
import glob
import random
import shutil
import string
# Module Imports
import click
import json
from passlib.hash import pbkdf2_sha256
import requests
# Initialize shutil copy function
cp = shutil.copyfile
# Define working director... | 3,165 | 0 | 66 |
df1c043bb7bb43c3c26ab0870c4b8a16d9ef8243 | 3,473 | py | Python | kubernetes_manager/models/mixins.py | breimers/Django-Kubernetes-Manager | cb78b51e6aeabcd4037166fa8e7c565180fb7d93 | [
"MIT"
] | 13 | 2020-04-03T08:33:51.000Z | 2022-02-22T07:30:28.000Z | kubernetes_manager/models/mixins.py | breimers/Django-Kubernetes-Manager | cb78b51e6aeabcd4037166fa8e7c565180fb7d93 | [
"MIT"
] | 27 | 2020-04-03T06:51:38.000Z | 2022-01-21T13:12:28.000Z | kubernetes_manager/models/mixins.py | breimers/Django-Kubernetes-Manager | cb78b51e6aeabcd4037166fa8e7c565180fb7d93 | [
"MIT"
] | 6 | 2020-09-14T18:22:37.000Z | 2022-03-04T09:08:25.000Z | import json
import re
from django.db import models
from kubernetes_manager.consts import byte_units
from kubernetes import client, config
class KubernetesTelemetryMixin(models.Model):
"""
KubernetesTelemetryMixin
:type: mixin
:description: Extends child model to include telemetry features.
:inher... | 40.383721 | 150 | 0.644112 | import json
import re
from django.db import models
from kubernetes_manager.consts import byte_units
from kubernetes import client, config
class KubernetesTelemetryMixin(models.Model):
"""
KubernetesTelemetryMixin
:type: mixin
:description: Extends child model to include telemetry features.
:inher... | 0 | 14 | 27 |
934d31a508b66a1a02b1795b287bf9626eda8d58 | 532 | py | Python | custom/icds_reports/migrations/0116_daily_attendance_index.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds_reports/migrations/0116_daily_attendance_index.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | 1 | 2021-06-02T04:45:16.000Z | 2021-06-02T04:45:16.000Z | custom/icds_reports/migrations/0116_daily_attendance_index.py | rochakchauhan/commcare-hq | aa7ab3c2d0c51fe10f2b51b08101bb4b5a376236 | [
"BSD-3-Clause"
] | null | null | null | from django.conf import settings
from django.db import migrations
| 24.181818 | 98 | 0.725564 | from django.conf import settings
from django.db import migrations
def get_operations():
if not settings.UNIT_TESTING:
return []
# only do this in unit tests - we'll manage the rollout manually
return [
migrations.RunSQL("CREATE INDEX idx_daily_attendance_awc_id ON daily_attendance (awc_id... | 240 | 178 | 46 |
714b4a2f2e9af1dd9a57e6cccb54c315267d07b3 | 4,734 | py | Python | h2o-py/tests/testdir_jira/pyunit_pubdev_6339.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2020-09-23T14:23:55.000Z | 2020-09-23T19:26:30.000Z | h2o-py/tests/testdir_jira/pyunit_pubdev_6339.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2 | 2021-06-02T02:24:03.000Z | 2021-11-15T17:51:49.000Z | h2o-py/tests/testdir_jira/pyunit_pubdev_6339.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | import sys
sys.path.insert(1,"../../")
import h2o
import math
import os
from tests import pyunit_utils
def calculate_chunk_size(file_path, num_cols, cores, cloud_size):
"""
Return size of a chunk calculated for optimal data handling in h2o java backend.
:param file_path: path to... | 45.085714 | 158 | 0.666878 | import sys
sys.path.insert(1,"../../")
import h2o
import math
import os
from tests import pyunit_utils
def pubdev_6339():
cluster = h2o.cluster()
# number of nodes
cloud_size = cluster.cloud_size
# number of CPUs
cores = sum(node["num_cpus"] for node in cluster.nodes)
# path to file
... | 1,353 | 0 | 23 |
528f10fec4d41d378b1cf1beea983a899c1d92e7 | 3,270 | py | Python | mule/task/docker/__init__.py | bricerisingalgorand/mule | 721b73f691076e5c3e2ebb8a79313da486fb0f96 | [
"MIT"
] | null | null | null | mule/task/docker/__init__.py | bricerisingalgorand/mule | 721b73f691076e5c3e2ebb8a79313da486fb0f96 | [
"MIT"
] | null | null | null | mule/task/docker/__init__.py | bricerisingalgorand/mule | 721b73f691076e5c3e2ebb8a79313da486fb0f96 | [
"MIT"
] | null | null | null | from mule.task import ITask
import mule.util.docker_util as docker
from mule.error import messages
from mule.util import update_dict
import re
| 28.189655 | 115 | 0.54526 | from mule.task import ITask
import mule.util.docker_util as docker
from mule.error import messages
from mule.util import update_dict
import re
class IDockerTask(ITask):
required_typed_fields = [
('docker', dict),
('docker.image', str),
('docker.version', str),
]
optional_typed_fiel... | 2,330 | 705 | 92 |
e6877b289de9f4cbafe2aaad04ce72e6187d0440 | 12,687 | py | Python | haptics_v2_I2C/code/drv.py | MissCrispenCakes/On-body-haptics | 80aeb115cdbd87d602a6092e9030fd754b1a8733 | [
"MIT"
] | 2 | 2020-02-17T14:34:59.000Z | 2022-01-21T12:59:38.000Z | haptics_v2_I2C/code/drv.py | MissCrispenCakes/On-body-haptics | 80aeb115cdbd87d602a6092e9030fd754b1a8733 | [
"MIT"
] | null | null | null | haptics_v2_I2C/code/drv.py | MissCrispenCakes/On-body-haptics | 80aeb115cdbd87d602a6092e9030fd754b1a8733 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_drv2605`
====================================================
CircuitPython module for the DRV2605 haptic feedback motor driver. See
examples/simpletest.py for a demo of the usage.
* Author(s... | 34.289189 | 108 | 0.639158 | # SPDX-FileCopyrightText: 2017 Tony DiCola for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_drv2605`
====================================================
CircuitPython module for the DRV2605 haptic feedback motor driver. See
examples/simpletest.py for a demo of the usage.
* Author(s... | 3,823 | 0 | 342 |
c8ba52a9abbd1aca12515a5959b6103736fcc1a5 | 481 | py | Python | test/descriptiondefinition_test.py | screamingskulls/sofi | 1d75bc97683151864f8a4cafb59ef8e50de63ee4 | [
"MIT"
] | 402 | 2016-04-05T23:11:07.000Z | 2022-02-22T21:10:49.000Z | test/descriptiondefinition_test.py | screamingskulls/sofi | 1d75bc97683151864f8a4cafb59ef8e50de63ee4 | [
"MIT"
] | 87 | 2016-03-31T00:09:39.000Z | 2021-02-22T04:49:25.000Z | test/descriptiondefinition_test.py | screamingskulls/sofi | 1d75bc97683151864f8a4cafb59ef8e50de63ee4 | [
"MIT"
] | 54 | 2016-03-31T00:10:33.000Z | 2021-06-23T21:38:36.000Z | from sofi.ui import DescriptionDefinition
| 40.083333 | 126 | 0.659044 | from sofi.ui import DescriptionDefinition
def test_basic():
assert(str(DescriptionDefinition()) == "<dd></dd>")
def test_text():
assert(str(DescriptionDefinition("text")) == "<dd>text</dd>")
def test_custom_class_ident_style_and_attrs():
assert(str(DescriptionDefinition("text", cl='abclass', ident='123',... | 370 | 0 | 69 |
88767af3e06e57b8c7fc3e93f65f513b73c71baf | 998 | py | Python | src/view/city_map_representation.py | Tequilac/Hacknarok2021 | ab4fae17afe4b109e35ba888e7a354aba18de426 | [
"MIT"
] | 1 | 2021-03-28T11:32:44.000Z | 2021-03-28T11:32:44.000Z | src/view/city_map_representation.py | Tequilac/Hacknarok2021 | ab4fae17afe4b109e35ba888e7a354aba18de426 | [
"MIT"
] | null | null | null | src/view/city_map_representation.py | Tequilac/Hacknarok2021 | ab4fae17afe4b109e35ba888e7a354aba18de426 | [
"MIT"
] | 1 | 2021-03-27T22:26:10.000Z | 2021-03-27T22:26:10.000Z | from .button import *
from settings import Colors
| 34.413793 | 87 | 0.650301 | from .button import *
from settings import Colors
class CityMapRepresentation(Button):
CITY_SIZE = {
'width': 100,
'height': 75,
}
CITY_FONT_SIZE = 18
CITY_FONT = pygame.font.SysFont("calibri", CITY_FONT_SIZE)
TEXT_VERTICAL_TRANSPOSITION = 77
TEXT_HORIZONTAL_TRANSPOSITION = 15... | 622 | 301 | 23 |
2aaaeb2bae03cff3ed739a05926117b3d845d87c | 370 | py | Python | links.py | raymond-devries/skagit60-scraping | bea9c41c7bb650abe77ae6c1bfa9f755f1e65846 | [
"MIT"
] | null | null | null | links.py | raymond-devries/skagit60-scraping | bea9c41c7bb650abe77ae6c1bfa9f755f1e65846 | [
"MIT"
] | null | null | null | links.py | raymond-devries/skagit60-scraping | bea9c41c7bb650abe77ae6c1bfa9f755f1e65846 | [
"MIT"
] | null | null | null | import pandas as pd
if __name__ == '__main__':
website = 'https://www.peakbagger.com/'
links = pd.read_csv('raw_data/links.csv')
links['full_link'] = website + links['link']
full_links = links[['Mountain', 'full_link']]
full_links = full_links.rename(columns={'full_link': 'link'})
full_links.t... | 33.636364 | 65 | 0.681081 | import pandas as pd
if __name__ == '__main__':
website = 'https://www.peakbagger.com/'
links = pd.read_csv('raw_data/links.csv')
links['full_link'] = website + links['link']
full_links = links[['Mountain', 'full_link']]
full_links = full_links.rename(columns={'full_link': 'link'})
full_links.t... | 0 | 0 | 0 |
77d41cb9debb2c88384d245d7612811bf818a866 | 3,971 | py | Python | pypro/settings.py | felipeapellegrini/curso-django | 9a552ae3cb6c100055814cc8530c8c9b531c95dd | [
"MIT"
] | null | null | null | pypro/settings.py | felipeapellegrini/curso-django | 9a552ae3cb6c100055814cc8530c8c9b531c95dd | [
"MIT"
] | 9 | 2021-08-14T14:38:23.000Z | 2021-08-17T03:11:53.000Z | pypro/settings.py | felipeapellegrini/curso-django | 9a552ae3cb6c100055814cc8530c8c9b531c95dd | [
"MIT"
] | null | null | null | import os
from pathlib import Path
from decouple import config, Csv
import dj_database_url
from functools import partial
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', cast=bool)
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
AUTH_USER_MODEL = 'bas... | 28.364286 | 91 | 0.714933 | import os
from pathlib import Path
from decouple import config, Csv
import dj_database_url
from functools import partial
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = config('SECRET_KEY')
DEBUG = config('DEBUG', cast=bool)
ALLOWED_HOSTS = config('ALLOWED_HOSTS', cast=Csv())
AUTH_USER_MODEL = 'bas... | 0 | 0 | 0 |
ca7e988ca9f110a9aa431e72730d28b2a4942fb1 | 934 | py | Python | combine_keys.py | dankov/windows-keylogger | 625a1ef0aa008a367f05fbc65958fafa87122b85 | [
"Unlicense"
] | 1 | 2018-03-09T15:57:57.000Z | 2018-03-09T15:57:57.000Z | combine_keys.py | dankov/windows-keylogger | 625a1ef0aa008a367f05fbc65958fafa87122b85 | [
"Unlicense"
] | null | null | null | combine_keys.py | dankov/windows-keylogger | 625a1ef0aa008a367f05fbc65958fafa87122b85 | [
"Unlicense"
] | null | null | null | from __future__ import print_function
import fileinput
import sys
keys_down = []
i = 0
for line in fileinput.input():
i += 1
split_line = line.rstrip().split(' ')
if len(split_line) != 2:
print('Unrecognized format on line ' + str(i), file=sys.stderr)
continue
action = split_line... | 30.129032 | 98 | 0.563169 | from __future__ import print_function
import fileinput
import sys
keys_down = []
i = 0
for line in fileinput.input():
i += 1
split_line = line.rstrip().split(' ')
if len(split_line) != 2:
print('Unrecognized format on line ' + str(i), file=sys.stderr)
continue
action = split_line... | 0 | 0 | 0 |
25227770d47c780541652a63d93c49110ceaf9d6 | 1,624 | py | Python | articles/migrations/0003_initial_pages.py | losolio/website | 5b983e9dfaf604212aab87c51d8904ffc29527a3 | [
"MIT"
] | 10 | 2015-12-18T16:41:33.000Z | 2018-11-11T08:36:46.000Z | articles/migrations/0003_initial_pages.py | losolio/website | 5b983e9dfaf604212aab87c51d8904ffc29527a3 | [
"MIT"
] | 96 | 2015-07-14T22:45:56.000Z | 2017-07-25T19:59:48.000Z | articles/migrations/0003_initial_pages.py | losolio/website | 5b983e9dfaf604212aab87c51d8904ffc29527a3 | [
"MIT"
] | 9 | 2015-07-28T14:38:43.000Z | 2019-01-04T17:38:42.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| 27.066667 | 80 | 0.658251 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_pages(apps, schema_editor):
Page = apps.get_model("wagtailcore", "Page")
SeriesListPage = apps.get_model("articles", "SeriesListPage")
ArticleListPage = apps.get_model("articles", "ArticleL... | 1,260 | 210 | 46 |
f373d9e39b7c68b7583c76a11336122d800a3114 | 2,142 | py | Python | misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 0515fe325ccf49c7914ea8aa1404cdee6dfe2648 | [
"MIT"
] | 39 | 2015-09-20T06:33:54.000Z | 2021-12-21T06:59:53.000Z | misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 0515fe325ccf49c7914ea8aa1404cdee6dfe2648 | [
"MIT"
] | 23 | 2015-09-23T12:00:43.000Z | 2020-05-27T15:42:11.000Z | misc/phyler_classify.py | hurwitzlab/LSA-pipeline | 0515fe325ccf49c7914ea8aa1404cdee6dfe2648 | [
"MIT"
] | 19 | 2015-10-16T21:40:12.000Z | 2020-11-10T07:58:00.000Z | #!/usr/bin/env python
import sys, getopt
import glob,os
# sample the first 10**7 reads
help_message = 'usage example: python read_phyler.py -r 1 -i /project/home/original_reads/ -o /project/home/phyler/'
if __name__ == "__main__":
try:
opts, args = getopt.getopt(sys.argv[1:],'hr:i:o:',["inputdir="])
except:
pr... | 34 | 304 | 0.653595 | #!/usr/bin/env python
import sys, getopt
import glob,os
# sample the first 10**7 reads
def get_fasta(fp,fo):
f = open(fp)
g = open(fo,'w')
lastlinechar = ''
writenext = False
read_count = 0
for line in f:
if (line[0] == '@') and (lastlinechar != '+'):
g.write('>'+line[1:])
writenext = True
read_count... | 372 | 0 | 22 |
be7e43fdc0aad4d4987f801c80b41cf68e61832d | 2,278 | py | Python | tests/components/neato/test_init.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | 2 | 2020-08-08T21:55:12.000Z | 2021-04-17T10:59:49.000Z | tests/components/neato/test_init.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | tests/components/neato/test_init.py | ottersen/home-assistant | 7a57c3a66af0e47cb6a1f9971dd2b14e6acae1bf | [
"Apache-2.0"
] | null | null | null | """Tests for the Neato init file."""
import pytest
from unittest.mock import patch
from homeassistant.components.neato.const import NEATO_DOMAIN, CONF_VENDOR
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
USE... | 32.084507 | 88 | 0.763828 | """Tests for the Neato init file."""
import pytest
from unittest.mock import patch
from homeassistant.components.neato.const import NEATO_DOMAIN, CONF_VENDOR
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
USE... | 0 | 0 | 0 |
80b912349ac11ba8537195cdab5d1879397d8dee | 15,119 | py | Python | diceseq/utils/bias_utils.py | huangyh09/diceseq | 86c0a598d85ca60816189d58d6b4b1a4541a8755 | [
"Apache-2.0"
] | 2 | 2016-09-11T20:55:09.000Z | 2019-06-05T15:55:54.000Z | diceseq/utils/bias_utils.py | huangyh09/diceseq | 86c0a598d85ca60816189d58d6b4b1a4541a8755 | [
"Apache-2.0"
] | 5 | 2015-11-05T07:31:57.000Z | 2021-12-10T09:00:54.000Z | diceseq/utils/bias_utils.py | huangyh09/diceseq | 86c0a598d85ca60816189d58d6b4b1a4541a8755 | [
"Apache-2.0"
] | 1 | 2016-06-07T14:49:47.000Z | 2016-06-07T14:49:47.000Z | # This module is to estimate the sequence or position biases. It provides
# ways to access and save the bias parameters.
import pysam
import numpy as np
import matplotlib.pyplot as plt
class FastaFile:
"""docstring for FastaFile"""
def get_seq(self, qref, start, stop):
"""get the sequence in a given ... | 43.950581 | 108 | 0.522587 | # This module is to estimate the sequence or position biases. It provides
# ways to access and save the bias parameters.
import pysam
import numpy as np
import matplotlib.pyplot as plt
def norm_pdf(x, mu, sigma):
return 1 / (sigma*np.sqrt(2*np.pi)) * np.exp(-1/2*((x-mu)/sigma)**2)
class FastaFile:
"""docstri... | 2,079 | 0 | 142 |
a58291551b1684d47a147ae46e5ed95fe5566b04 | 535 | py | Python | mollie/api/resources/methods.py | bryanwills/mollie-api-python | 8122569ae83f07ad07893f3dd56e9a60bcccae05 | [
"BSD-2-Clause"
] | 95 | 2015-02-22T23:32:13.000Z | 2022-02-17T21:28:19.000Z | mollie/api/resources/methods.py | bryanwills/mollie-api-python | 8122569ae83f07ad07893f3dd56e9a60bcccae05 | [
"BSD-2-Clause"
] | 108 | 2015-02-26T08:51:35.000Z | 2021-10-10T12:57:55.000Z | mollie/api/resources/methods.py | bryanwills/mollie-api-python | 8122569ae83f07ad07893f3dd56e9a60bcccae05 | [
"BSD-2-Clause"
] | 70 | 2015-01-17T17:47:56.000Z | 2022-01-18T17:31:12.000Z | from ..objects.list import ObjectList
from ..objects.method import Method
from .base import ResourceBase
| 35.666667 | 103 | 0.715888 | from ..objects.list import ObjectList
from ..objects.method import Method
from .base import ResourceBase
class Methods(ResourceBase):
def get_resource_object(self, result):
return Method(result)
def all(self, **params):
"""List all mollie payment methods, including methods that aren't activat... | 47 | 359 | 23 |
f5af795b06147398ed28b00bc906b2301431b8fd | 348 | py | Python | tests/unit/test_reset.py | warmchang/microk8s | 8b1649b9667297b3cd93e89918ab435d460e6ddf | [
"Apache-2.0"
] | 144 | 2022-02-22T18:48:22.000Z | 2022-03-30T14:09:40.000Z | tests/unit/test_reset.py | canonical/microk8s | 9d51befb4f89ae3f2c85c49a6fea8e8672aa1c40 | [
"Apache-2.0"
] | 75 | 2022-02-22T19:31:46.000Z | 2022-03-31T20:42:48.000Z | tests/unit/test_reset.py | warmchang/microk8s | 8b1649b9667297b3cd93e89918ab435d460e6ddf | [
"Apache-2.0"
] | 18 | 2022-02-24T15:05:18.000Z | 2022-03-30T02:34:42.000Z | from click.testing import CliRunner
from reset import reset as command
| 31.636364 | 87 | 0.698276 | from click.testing import CliRunner
from reset import reset as command
def test_command_help_arguments():
runner = CliRunner()
for help_arg in ("-h", "--help"):
result = runner.invoke(command, [help_arg])
assert result.exit_code == 0
assert "Return the MicroK8s node to the default init... | 253 | 0 | 23 |
dce85f0ee9a29c2bcce281aba7816c15c67235a0 | 310 | py | Python | ch06_timer.py | jeffreycoen/prog_mb | 739e9869b51dc861a57da697d49406b1394ade6d | [
"MIT"
] | 13 | 2017-12-05T16:28:14.000Z | 2022-02-21T22:05:00.000Z | ch06_timer.py | jeffreycoen/prog_mb | 739e9869b51dc861a57da697d49406b1394ade6d | [
"MIT"
] | null | null | null | ch06_timer.py | jeffreycoen/prog_mb | 739e9869b51dc861a57da697d49406b1394ade6d | [
"MIT"
] | 5 | 2018-03-23T20:14:18.000Z | 2021-03-15T06:37:58.000Z | from microbit import *
SET, RUN, ALARM = range(3)
state = SET
while True:
if state == SET:
handle_set_state()
elif state == RUN:
handle_run_state()
elif state == ALARM:
handle_alarm_state() | 17.222222 | 28 | 0.635484 | from microbit import *
SET, RUN, ALARM = range(3)
state = SET
def handle_set_state():
def handle_run_state():
def handle_alarm_state():
while True:
if state == SET:
handle_set_state()
elif state == RUN:
handle_run_state()
elif state == ALARM:
handle_alarm_state() | 8 | 0 | 74 |
5487aa7a87ffb31dd6644be5389af666ff0e48f2 | 6,798 | py | Python | src/Input.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 33 | 2015-01-02T08:14:39.000Z | 2021-12-08T16:13:12.000Z | src/Input.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 2 | 2018-03-03T09:18:58.000Z | 2020-06-29T08:25:20.000Z | src/Input.py | stbnps/DanceCV | ac94f5f715c246a50f67f99abbe926a7461fba11 | [
"BSD-3-Clause"
] | 17 | 2015-11-22T03:42:59.000Z | 2021-11-18T13:05:05.000Z | # -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Sánchez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list ... | 38.845714 | 194 | 0.644013 | # -*- coding: utf-8 -*-
'''
Copyright (c) 2014, Esteban Pardo Sánchez
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list ... | 4,782 | -7 | 371 |
f44633353d58737608b47b708734fd303d9bd3db | 10,998 | py | Python | test/test_polytaxis.py | Rendaw/polytaxis-python | f2b2d62f6fbe7549ef0f737ede5bf65a260f299c | [
"BSD-2-Clause"
] | null | null | null | test/test_polytaxis.py | Rendaw/polytaxis-python | f2b2d62f6fbe7549ef0f737ede5bf65a260f299c | [
"BSD-2-Clause"
] | 1 | 2015-07-17T00:19:00.000Z | 2015-07-17T00:32:32.000Z | test/test_polytaxis.py | Rendaw/polytaxis-python | f2b2d62f6fbe7549ef0f737ede5bf65a260f299c | [
"BSD-2-Clause"
] | null | null | null | import unittest
import io
import os
import collections
import polytaxis
normal_tags = {'a': set(['a'])}
raw_unsized_notags = (
b'polytaxis00u\n'
b'<<<<\n'
b'wug'
)
raw_unsized_normal = (
b'polytaxis00u\n'
b'a=a\n'
b'<<<<\n'
b'wug'
)
raw_sized_minimized_notags = (
b'polytaxis00 0000... | 26.759124 | 76 | 0.518822 | import unittest
import io
import os
import collections
import polytaxis
normal_tags = {'a': set(['a'])}
raw_unsized_notags = (
b'polytaxis00u\n'
b'<<<<\n'
b'wug'
)
raw_unsized_normal = (
b'polytaxis00u\n'
b'a=a\n'
b'<<<<\n'
b'wug'
)
raw_sized_minimized_notags = (
b'polytaxis00 0000... | 9,013 | 89 | 1,208 |
2078966976e3e91e72cb59968a45cb674edb71d8 | 1,651 | py | Python | hole_filling/fill.py | Rhoana/block_based_synapse_aware | 744b9b91031d0eb0570d309d97563182b768a9d8 | [
"MIT"
] | 2 | 2020-04-14T07:51:02.000Z | 2022-03-25T08:09:04.000Z | hole_filling/fill.py | Rhoana/block_based_synapse_aware | 744b9b91031d0eb0570d309d97563182b768a9d8 | [
"MIT"
] | null | null | null | hole_filling/fill.py | Rhoana/block_based_synapse_aware | 744b9b91031d0eb0570d309d97563182b768a9d8 | [
"MIT"
] | 3 | 2020-04-10T08:33:11.000Z | 2020-05-19T06:51:23.000Z | import os
from blockbased_synapseaware.hole_filling.components import FindPerBlockConnectedComponents
from blockbased_synapseaware.hole_filling.connect import ConnectLabelsAcrossBlocks, CombineAssociatedLabels
from blockbased_synapseaware.hole_filling.mapping import RemoveHoles
from blockbased_synapseaware.utilities... | 40.268293 | 107 | 0.715324 | import os
from blockbased_synapseaware.hole_filling.components import FindPerBlockConnectedComponents
from blockbased_synapseaware.hole_filling.connect import ConnectLabelsAcrossBlocks, CombineAssociatedLabels
from blockbased_synapseaware.hole_filling.mapping import RemoveHoles
from blockbased_synapseaware.utilities... | 1,220 | 0 | 23 |
8dcd37bb6d5a541f465e86e550f4110e352cf88b | 7,984 | py | Python | mainframe.py | bcorfman/raven-checkers | 8de758acfd42bb151cfc7311130b27e42ccd098d | [
"MIT"
] | 25 | 2016-03-30T18:03:17.000Z | 2021-11-09T12:07:00.000Z | mainframe.py | bcorfman/raven-checkers | 8de758acfd42bb151cfc7311130b27e42ccd098d | [
"MIT"
] | 3 | 2016-11-27T07:59:44.000Z | 2018-06-05T01:15:35.000Z | mainframe.py | bcorfman/raven-checkers | 8de758acfd42bb151cfc7311130b27e42ccd098d | [
"MIT"
] | 13 | 2016-02-21T19:57:57.000Z | 2021-03-01T10:31:14.000Z | import os
from Tkinter import IntVar, Menu, Tk
import Tkinter as tk
from tkMessageBox import askyesnocancel
from multiprocessing import freeze_support
from globalconst import RAVEN_ICON, VERSION, TITLE, BLACK, get_preferences_from_file, write_preferences_to_file
from aboutbox import AboutBox
from setupboard impo... | 42.021053 | 112 | 0.596192 | import os
from Tkinter import IntVar, Menu, Tk
import Tkinter as tk
from tkMessageBox import askyesnocancel
from multiprocessing import freeze_support
from globalconst import RAVEN_ICON, VERSION, TITLE, BLACK, get_preferences_from_file, write_preferences_to_file
from aboutbox import AboutBox
from setupboard impo... | 6,928 | 19 | 512 |
14a2b5374540915ca3b90707995f417ab188c692 | 2,242 | py | Python | data/train/python/14a2b5374540915ca3b90707995f417ab188c692main.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/14a2b5374540915ca3b90707995f417ab188c692main.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/14a2b5374540915ca3b90707995f417ab188c692main.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | import pygame
import sys
import time
from intro_controller import IntroController
from settings import RESOLUTION
from spacebar_controller import SpacebarController, LONGPRESS, SHORTPRESS
from game_controller import ControllerResignException
from gameplay_controller import GameplayController
from outro_controller impo... | 30.297297 | 73 | 0.683318 | import pygame
import sys
import time
from intro_controller import IntroController
from settings import RESOLUTION
from spacebar_controller import SpacebarController, LONGPRESS, SHORTPRESS
from game_controller import ControllerResignException
from gameplay_controller import GameplayController
from outro_controller impo... | 1,623 | 15 | 123 |
78f6cf1986f4440b85c57219746f1e704897cec0 | 4,053 | py | Python | CrySPY/interface/select_code.py | nbsato/CrySPY | 663a7d714144e76bfae751dffedcf781d3976c4e | [
"MIT"
] | null | null | null | CrySPY/interface/select_code.py | nbsato/CrySPY | 663a7d714144e76bfae751dffedcf781d3976c4e | [
"MIT"
] | null | null | null | CrySPY/interface/select_code.py | nbsato/CrySPY | 663a7d714144e76bfae751dffedcf781d3976c4e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from VASP import calc_files_vasp, ctrl_job_vasp, collect_vasp
from QE import calc_files_qe, ctrl_job_qe, collect_qe
from soiap import calc_files_soiap, ctrl_job_soiap, collect_soiap
from ..IO import read_input as rin
| 35.867257 | 115 | 0.675302 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from VASP import calc_files_vasp, ctrl_job_vasp, collect_vasp
from QE import calc_files_qe, ctrl_job_qe, collect_qe
from soiap import calc_files_soiap, ctrl_job_soiap, collect_soiap
from ..IO import read_input as rin
def check_calc_files():
if rin.calc_code == 'VASP'... | 3,597 | 0 | 184 |
0f15b459143cf0f7a6b7b0fe5249f3dddaaa906a | 21,265 | py | Python | biothings_explorer/utils/simple_semmed.py | luluricketts/biothings_explorer | ae2009ff285f96a08e0145f242846ca613b5069c | [
"Apache-2.0"
] | 21 | 2017-07-22T10:08:03.000Z | 2022-01-11T08:53:14.000Z | biothings_explorer/utils/simple_semmed.py | luluricketts/biothings_explorer | ae2009ff285f96a08e0145f242846ca613b5069c | [
"Apache-2.0"
] | 127 | 2017-07-22T10:19:45.000Z | 2021-11-04T01:23:43.000Z | biothings_explorer/utils/simple_semmed.py | luluricketts/biothings_explorer | ae2009ff285f96a08e0145f242846ca613b5069c | [
"Apache-2.0"
] | 18 | 2017-04-27T17:02:06.000Z | 2021-07-25T18:13:56.000Z | semmed = {
"AnatomicalEntity": {
"affected_by": [
"ChemicalSubstance",
"BiologicalProcess",
"Disease",
"Gene",
"CellularComponent"
],
"affects": [
"Disease",
"BiologicalProcess"
],
"causes": [... | 24.555427 | 38 | 0.408747 | semmed = {
"AnatomicalEntity": {
"affected_by": [
"ChemicalSubstance",
"BiologicalProcess",
"Disease",
"Gene",
"CellularComponent"
],
"affects": [
"Disease",
"BiologicalProcess"
],
"causes": [... | 0 | 0 | 0 |
92f2f0df370ff6ad3c19574c1c849f73c1ae1bfc | 1,015 | py | Python | like/migrations/0001_initial.py | engineer237/Project-Track-Api | 505f95d886144bbafd00797b25bd1c8940529e3f | [
"MIT"
] | null | null | null | like/migrations/0001_initial.py | engineer237/Project-Track-Api | 505f95d886144bbafd00797b25bd1c8940529e3f | [
"MIT"
] | null | null | null | like/migrations/0001_initial.py | engineer237/Project-Track-Api | 505f95d886144bbafd00797b25bd1c8940529e3f | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-04-12 14:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 36.25 | 152 | 0.64335 | # Generated by Django 4.0.3 on 2022-04-12 14:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('projects', '0001_initial'),
migrations.swappable_dependency(set... | 0 | 835 | 23 |
1d8643819b6fd2cc7279940e0eb8e114425632a1 | 465 | py | Python | mayan/apps/ocr/runtime.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/ocr/runtime.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 7 | 2020-06-06T00:01:04.000Z | 2022-01-13T01:47:17.000Z | mayan/apps/ocr/runtime.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
from django.utils.module_loading import import_string
from .settings import setting_ocr_backend, setting_ocr_backend_arguments
ocr_backend = import_string(
... | 22.142857 | 77 | 0.787097 | from __future__ import unicode_literals
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
from django.utils.module_loading import import_string
from .settings import setting_ocr_backend, setting_ocr_backend_arguments
ocr_backend = import_string(
... | 0 | 0 | 0 |
fcd9cb1e9903412012ebf931f3e03af6a0150244 | 5,501 | py | Python | scarlett_os/scripts/cli.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 5 | 2016-11-08T21:01:00.000Z | 2018-05-07T11:02:43.000Z | scarlett_os/scripts/cli.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 854 | 2016-09-21T13:06:32.000Z | 2022-02-10T13:21:47.000Z | scarlett_os/scripts/cli.py | bossjones/scarlett-os | dc3b96604220a5848c51a14a343e97d464ad811b | [
"Apache-2.0"
] | 2 | 2016-12-02T15:12:41.000Z | 2017-02-25T08:21:56.000Z | # -*- coding: utf-8 -*-
"""
Main click group for CLI
"""
import logging
import os
import sys
import click
from click_plugins import with_plugins
# from pkg_resources import iter_entry_points
import scarlett_os
from scarlett_os.common.configure.ruamel_config import ConfigManager
# from scarlett_os.compat import con... | 27.923858 | 123 | 0.644792 | # -*- coding: utf-8 -*-
"""
Main click group for CLI
"""
import logging
import os
import sys
import click
from click_plugins import with_plugins
# from pkg_resources import iter_entry_points
import scarlett_os
from scarlett_os.common.configure.ruamel_config import ConfigManager
# from scarlett_os.compat import con... | 0 | 0 | 0 |
9b2fa70c7cc513935bdf2d3cea2c3b5c92bbf5cb | 848 | py | Python | podiomirror/transactions/merged_relation_transaction.py | patriksletmo/podio-mirror | 4a0b1c079028bd29636352aca967ccf1e4a3f42d | [
"MIT"
] | null | null | null | podiomirror/transactions/merged_relation_transaction.py | patriksletmo/podio-mirror | 4a0b1c079028bd29636352aca967ccf1e4a3f42d | [
"MIT"
] | null | null | null | podiomirror/transactions/merged_relation_transaction.py | patriksletmo/podio-mirror | 4a0b1c079028bd29636352aca967ccf1e4a3f42d | [
"MIT"
] | null | null | null | from podiomirror.transactions.transaction import Transaction, MODIFY_RELATION
| 27.354839 | 77 | 0.673349 | from podiomirror.transactions.transaction import Transaction, MODIFY_RELATION
class MergedRelationTransaction(Transaction):
def __init__(self, app_id=None, field_id=None, parent_id=None):
super().__init__(MODIFY_RELATION)
self.app_id = app_id
self.field_id = field_id
self.parent_i... | 588 | 24 | 157 |
c1150513fa39ea51f040e89dddcfa3368bd9d78f | 2,361 | py | Python | Module02/guess_my_primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Yilin-Y | 25a096cd5ebb848de727b989a85bd08e5e5e5652 | [
"MIT"
] | null | null | null | Module02/guess_my_primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Yilin-Y | 25a096cd5ebb848de727b989a85bd08e5e5e5652 | [
"MIT"
] | null | null | null | Module02/guess_my_primer.py | biomed-bioinformatics-bootcamp/bmes-t580-2019-coursework-Yilin-Y | 25a096cd5ebb848de727b989a85bd08e5e5e5652 | [
"MIT"
] | null | null | null | # Yilin Wang
# pre_lecture assignment
# BMES T580
import random
import math
print('**********************************')
print(' GUESS_THAT_PRIMER GAME ')
print('**********************************')
print()
DNA = ['A','G','C','T'] # DNA base
# set the initial sequence as a empty string
# the base will be added int... | 38.704918 | 130 | 0.668784 | # Yilin Wang
# pre_lecture assignment
# BMES T580
import random
import math
print('**********************************')
print(' GUESS_THAT_PRIMER GAME ')
print('**********************************')
print()
DNA = ['A','G','C','T'] # DNA base
# set the initial sequence as a empty string
# the base will be added int... | 0 | 0 | 0 |
3d2a49fdd38d76b79a7206d06b9514b7919ddbe3 | 597 | py | Python | unit_tests/application_category.py | realvitya/fmcapi | 38fb9a8da2d9ebbadf4ed4cb559244646b3bf3be | [
"BSD-3-Clause"
] | 57 | 2017-06-13T17:06:20.000Z | 2021-07-27T08:53:25.000Z | unit_tests/application_category.py | realvitya/fmcapi | 38fb9a8da2d9ebbadf4ed4cb559244646b3bf3be | [
"BSD-3-Clause"
] | 66 | 2017-11-09T16:02:45.000Z | 2021-08-04T20:52:41.000Z | unit_tests/application_category.py | realvitya/fmcapi | 38fb9a8da2d9ebbadf4ed4cb559244646b3bf3be | [
"BSD-3-Clause"
] | 56 | 2017-06-08T07:53:12.000Z | 2021-07-30T13:26:47.000Z | import logging
import fmcapi
| 28.428571 | 66 | 0.695142 | import logging
import fmcapi
def test__application_category(fmc):
logging.info("Testing ApplicationCategory class.")
obj1 = fmcapi.ApplicationCategories(fmc=fmc)
logging.info("All ApplicationCategories -- >")
result = obj1.get()
logging.info(result)
logging.info(f"Total items: {len(result['it... | 544 | 0 | 23 |
02434b5ddafacfc9ac46e93b0bce94475b975a5d | 385 | py | Python | final_exam_prep/regex_fancy_barcodes.py | lowrybg/SoftuniPythonFund | ab80c424c35824bbfda5f43f1ba8ba5aa2f4efb5 | [
"MIT"
] | null | null | null | final_exam_prep/regex_fancy_barcodes.py | lowrybg/SoftuniPythonFund | ab80c424c35824bbfda5f43f1ba8ba5aa2f4efb5 | [
"MIT"
] | null | null | null | final_exam_prep/regex_fancy_barcodes.py | lowrybg/SoftuniPythonFund | ab80c424c35824bbfda5f43f1ba8ba5aa2f4efb5 | [
"MIT"
] | null | null | null | import re
number = int(input())
pattern_valid = r"@#+[A-Z][A-Za-z0-9]{4,}[A-Z]@#+"
for _ in range(number):
lines = input()
if re.match(pattern_valid,lines):
digits = re.findall(r"\d", lines)
if digits:
print(f'Product group: {"".join(digits)}')
else:
print... | 17.5 | 54 | 0.532468 | import re
number = int(input())
pattern_valid = r"@#+[A-Z][A-Za-z0-9]{4,}[A-Z]@#+"
for _ in range(number):
lines = input()
if re.match(pattern_valid,lines):
digits = re.findall(r"\d", lines)
if digits:
print(f'Product group: {"".join(digits)}')
else:
print... | 0 | 0 | 0 |