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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e4e2c057d716503e6ba0401dde6b3f5ad2e211c8 | 1,959 | py | Python | shablbot/core/utils.py | Blackgard/vk-bot-python | 5d1eb269d76567a8e31dec47c0ea3c5cc1bcbc3c | [
"MIT"
] | 5 | 2019-11-12T05:15:07.000Z | 2022-01-20T06:26:55.000Z | shablbot/core/utils.py | Blackgard/vk-bot-python | 5d1eb269d76567a8e31dec47c0ea3c5cc1bcbc3c | [
"MIT"
] | 1 | 2021-06-02T00:33:47.000Z | 2021-06-02T00:33:47.000Z | shablbot/core/utils.py | Blackgard/vk-bot-python | 5d1eb269d76567a8e31dec47c0ea3c5cc1bcbc3c | [
"MIT"
] | 2 | 2021-12-18T17:03:10.000Z | 2022-01-29T17:08:35.000Z | from typing import Any, List, Dict
from anytree import Node, RenderTree, ContRoundStyle
class RenderState:
" Render state class. View shablbot module active in tree style. "
def render(self, style = ContRoundStyle) -> None:
""" Render tree with state bot modules.
Args:
style ([t... | 31.596774 | 129 | 0.634507 | from typing import Any, List, Dict
from anytree import Node, RenderTree, ContRoundStyle
class RenderState:
" Render state class. View shablbot module active in tree style. "
def __init__(self, modules: Dict[str, Any], main_root: Node = None):
self.modules = modules
self.main_root = main_root
... | 643 | 0 | 53 |
3e4bd952403d2276a16fe6e594f1e94e0b8e90bf | 740 | py | Python | examples/plot_2d_graph.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | examples/plot_2d_graph.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | examples/plot_2d_graph.py | gfngoncalves/foam_graph | b1b735aef3eeaa6e9b8430c5520abff871ce3ffb | [
"MIT"
] | null | null | null | # %%
import matplotlib.pyplot as plt
from torch_geometric.data import download_url, extract_tar
from foam_graph.utils.graph_from_foam import read_foam
from foam_graph.visualization.graph_plotting import plot_graph
# %% Extract tar and read case as a graph
download_url("https://github.com/gfngoncalves/openfoam_cases/bl... | 26.428571 | 102 | 0.752703 | # %%
import matplotlib.pyplot as plt
from torch_geometric.data import download_url, extract_tar
from foam_graph.utils.graph_from_foam import read_foam
from foam_graph.visualization.graph_plotting import plot_graph
# %% Extract tar and read case as a graph
download_url("https://github.com/gfngoncalves/openfoam_cases/bl... | 0 | 0 | 0 |
3093dbc865abb3135a47c825de9eebf66e5d0d5e | 4,954 | py | Python | src/VersionControl/Git/Branches/Feature/Finish.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | null | null | null | src/VersionControl/Git/Branches/Feature/Finish.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | 44 | 2019-04-05T06:08:15.000Z | 2021-09-13T19:37:49.000Z | src/VersionControl/Git/Branches/Feature/Finish.py | flexiooss/flexio-flow | 47491c7e5b49a02dc859028de0d486edc0014b26 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import Type, Optional, List
from Exceptions.BranchHaveDiverged import BranchHaveDiverged
from Exceptions.BranchNotExist import BranchNotExist
from Exceptions.GitMergeConflictError import GitMergeConflictError
from Exceptions.NotCleanWorkingTree import NotCleanWorkingTree... | 35.898551 | 116 | 0.646952 | from __future__ import annotations
from typing import Type, Optional, List
from Exceptions.BranchHaveDiverged import BranchHaveDiverged
from Exceptions.BranchNotExist import BranchNotExist
from Exceptions.GitMergeConflictError import GitMergeConflictError
from Exceptions.NotCleanWorkingTree import NotCleanWorkingTree... | 3,954 | -8 | 238 |
a980fa4865ba7ee280855f960b289e3b10b23ac7 | 3,439 | py | Python | omega_format/dynamics/dynamic_object.py | kai-storms/omega_format | 745f67d774d2da04201de9fe24fa24468a8b191b | [
"MIT"
] | 11 | 2021-07-15T13:47:59.000Z | 2022-03-16T14:06:22.000Z | omega_format/dynamics/dynamic_object.py | kai-storms/omega_format | 745f67d774d2da04201de9fe24fa24468a8b191b | [
"MIT"
] | 1 | 2022-01-19T10:15:05.000Z | 2022-01-31T12:28:35.000Z | omega_format/dynamics/dynamic_object.py | kai-storms/omega_format | 745f67d774d2da04201de9fe24fa24468a8b191b | [
"MIT"
] | 2 | 2021-07-17T05:37:09.000Z | 2022-01-20T07:35:50.000Z | from dataclasses import fields
from pydantic import conint
from pydantic.fields import Field
import numpy as np
from .bounding_box import BoundingBox
from .trajectory import Trajectory
from ..settings import DefaultValues
from ..enums import ReferenceTypes
from ..geometry import BBXCornersClass
from ..reference_resol... | 33.715686 | 98 | 0.635941 | from dataclasses import fields
from pydantic import conint
from pydantic.fields import Field
import numpy as np
from .bounding_box import BoundingBox
from .trajectory import Trajectory
from ..settings import DefaultValues
from ..enums import ReferenceTypes
from ..geometry import BBXCornersClass
from ..reference_resol... | 2,362 | 506 | 46 |
5ef70e448176718d624998272370abec0f1efc36 | 8,695 | py | Python | src/django_vcs_watch/models.py | svetlyak40wt/django-vcs-watch | fa341c488b8a863812dd2b25cb0bda6d9beffdc9 | [
"BSD-3-Clause"
] | 1 | 2016-05-08T13:45:53.000Z | 2016-05-08T13:45:53.000Z | src/django_vcs_watch/models.py | svetlyak40wt/django-vcs-watch | fa341c488b8a863812dd2b25cb0bda6d9beffdc9 | [
"BSD-3-Clause"
] | null | null | null | src/django_vcs_watch/models.py | svetlyak40wt/django-vcs-watch | fa341c488b8a863812dd2b25cb0bda6d9beffdc9 | [
"BSD-3-Clause"
] | 1 | 2019-06-10T16:49:02.000Z | 2019-06-10T16:49:02.000Z | import calendar
import datetime
import logging
import operator
import os
import pytz
from pdb import set_trace
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import DjangoUnico... | 28.601974 | 110 | 0.6046 | import calendar
import datetime
import logging
import operator
import os
import pytz
from pdb import set_trace
from django.db import models
from django.conf import settings
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import DjangoUnico... | 6,308 | 1,017 | 161 |
3038ed4fb65985a3d843541d067e12a19deb1be3 | 1,225 | py | Python | act_to_gpl.py | muys4970/small_scripts | 4bcafd74c47a2b0c24aa67ac9f95611cf45f148b | [
"MIT"
] | 11 | 2021-01-04T18:16:34.000Z | 2022-03-07T20:18:42.000Z | act_to_gpl.py | muys4970/small_scripts | 4bcafd74c47a2b0c24aa67ac9f95611cf45f148b | [
"MIT"
] | null | null | null | act_to_gpl.py | muys4970/small_scripts | 4bcafd74c47a2b0c24aa67ac9f95611cf45f148b | [
"MIT"
] | 8 | 2020-12-11T00:51:18.000Z | 2022-01-13T18:52:41.000Z | #!/usr/bin/env python3
#
# Adobe Photoshop "*.act" palette file conversion to GIMP "*.gpl" palette
# format (which is also recognized by many other tools).
#
# How to use:
# ./act_to_gpl.py some_palette.act > some_palette.gpl
#
# Code based on swatchbook/codecs/adobe_act.py from:
# http://www.selapa.net/swatchbooker/... | 26.630435 | 82 | 0.610612 | #!/usr/bin/env python3
#
# Adobe Photoshop "*.act" palette file conversion to GIMP "*.gpl" palette
# format (which is also recognized by many other tools).
#
# How to use:
# ./act_to_gpl.py some_palette.act > some_palette.gpl
#
# Code based on swatchbook/codecs/adobe_act.py from:
# http://www.selapa.net/swatchbooker/... | 687 | 0 | 46 |
02ce5f1acf7dc53c2d03827ffa1683a44ab3b7ae | 2,444 | py | Python | predictor.py | ved789/ImageReader | 9d1f2bec9a7ccc270d9125a4e53bb93642662e34 | [
"Apache-2.0"
] | 1 | 2021-09-01T07:00:45.000Z | 2021-09-01T07:00:45.000Z | predictor.py | ved789/ImageReader | 9d1f2bec9a7ccc270d9125a4e53bb93642662e34 | [
"Apache-2.0"
] | null | null | null | predictor.py | ved789/ImageReader | 9d1f2bec9a7ccc270d9125a4e53bb93642662e34 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, redirect, render_template
from werkzeug.utils import secure_filename
import os
import tensorflow as tf
import numpy as np
import cv2
food_classes = ['Broken street sign', 'Damaged bollard', 'Damaged street light', 'Pothole']
app = Flask(__name__, static_url_path='/static')
app.conf... | 27.155556 | 137 | 0.645254 | from flask import Flask, request, redirect, render_template
from werkzeug.utils import secure_filename
import os
import tensorflow as tf
import numpy as np
import cv2
food_classes = ['Broken street sign', 'Damaged bollard', 'Damaged street light', 'Pothole']
app = Flask(__name__, static_url_path='/static')
app.conf... | 1,660 | 0 | 67 |
5d31335ada9205591b56e394c748cdabaffb4985 | 1,284 | py | Python | src/dynamic-programming/mccall-job-search/opt-policy-example-0.py | jackg0/quantecon | 6f8305a41969ad9dbb8d6bf824054f695ec5ef89 | [
"MIT"
] | null | null | null | src/dynamic-programming/mccall-job-search/opt-policy-example-0.py | jackg0/quantecon | 6f8305a41969ad9dbb8d6bf824054f695ec5ef89 | [
"MIT"
] | null | null | null | src/dynamic-programming/mccall-job-search/opt-policy-example-0.py | jackg0/quantecon | 6f8305a41969ad9dbb8d6bf824054f695ec5ef89 | [
"MIT"
] | null | null | null | import numpy as np
from numba import jit
import matplotlib.pyplot as plt
import quantecon as qe
from quantecon.distributions import BetaBinomial
n, a, b = 50, 200, 100
w_min, w_max = 10, 60
w_vals = np.linspace(w_min, w_max, n+1)
dist = BetaBinomial(n, a, b)
psi_vals = dist.pdf()
reservation_wage = compute_reserv... | 25.176471 | 99 | 0.658879 | import numpy as np
from numba import jit
import matplotlib.pyplot as plt
import quantecon as qe
from quantecon.distributions import BetaBinomial
n, a, b = 50, 200, 100
w_min, w_max = 10, 60
w_vals = np.linspace(w_min, w_max, n+1)
dist = BetaBinomial(n, a, b)
psi_vals = dist.pdf()
def plot_w_distribution(w_vals, psi_... | 840 | 0 | 69 |
b003aa22f4a17b7c6740683c9d583a5038ef68eb | 1,587 | py | Python | main.py | AlessandroChen/AutoCnblogs | a537c94560e8dad8fe33a845ab9db2b45f80efe3 | [
"Apache-2.0"
] | null | null | null | main.py | AlessandroChen/AutoCnblogs | a537c94560e8dad8fe33a845ab9db2b45f80efe3 | [
"Apache-2.0"
] | null | null | null | main.py | AlessandroChen/AutoCnblogs | a537c94560e8dad8fe33a845ab9db2b45f80efe3 | [
"Apache-2.0"
] | null | null | null | import xmlrpc.client as xmlrpclib
import json
config_path = "./blog_config.json"
def have_config():
'''
return bool value : whether config file exists
'''
try:
with open(config_path, "r", encoding = "utf-8") as f:
try:
cfg = json.load(f)
return cfg !... | 28.854545 | 61 | 0.507246 | import xmlrpc.client as xmlrpclib
import json
config_path = "./blog_config.json"
def have_config():
'''
return bool value : whether config file exists
'''
try:
with open(config_path, "r", encoding = "utf-8") as f:
try:
cfg = json.load(f)
return cfg !... | 0 | 0 | 0 |
4f90ba328bb371e24b317ddc9c92bfb92e127e4e | 383 | py | Python | dhukiya/apps/account/migrations/0004_account_about_me.py | fikryans/dhukiya_porto | 9108e51a2feeb275e07c77f81edae07636cf89b6 | [
"MIT"
] | null | null | null | dhukiya/apps/account/migrations/0004_account_about_me.py | fikryans/dhukiya_porto | 9108e51a2feeb275e07c77f81edae07636cf89b6 | [
"MIT"
] | null | null | null | dhukiya/apps/account/migrations/0004_account_about_me.py | fikryans/dhukiya_porto | 9108e51a2feeb275e07c77f81edae07636cf89b6 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.6 on 2021-02-11 12:42
from django.db import migrations, models
| 20.157895 | 47 | 0.5953 | # Generated by Django 3.1.6 on 2021-02-11 12:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0003_auto_20210211_1228'),
]
operations = [
migrations.AddField(
model_name='account',
name='about_me',
... | 0 | 269 | 23 |
2a41a21fd019fee9b2c95b90771bd8705ec86740 | 12,272 | py | Python | referencesrv/resolver/common.py | golnazads/reference_service | 3cdd60d1113de099d3b355c1076badeec15f767d | [
"MIT"
] | 1 | 2021-04-28T21:14:30.000Z | 2021-04-28T21:14:30.000Z | referencesrv/resolver/common.py | golnazads/reference_service | 3cdd60d1113de099d3b355c1076badeec15f767d | [
"MIT"
] | 5 | 2020-12-22T19:07:08.000Z | 2022-02-28T15:38:53.000Z | referencesrv/resolver/common.py | golnazads/reference_service | 3cdd60d1113de099d3b355c1076badeec15f767d | [
"MIT"
] | 8 | 2019-08-29T21:22:33.000Z | 2021-11-10T18:06:47.000Z | import traceback
from flask import current_app
from numbers import Real
from decimal import Decimal
from itertools import tee, filterfalse
class DeferredSourceMatcher(object):
"""
# Defer loading of the actual source matcher to runtime to save on
# startup time when we don't need it.
"""
def __g... | 26.562771 | 100 | 0.592731 | import traceback
from flask import current_app
from numbers import Real
from decimal import Decimal
from itertools import tee, filterfalse
class DeferredSourceMatcher(object):
"""
# Defer loading of the actual source matcher to runtime to save on
# startup time when we don't need it.
"""
def __g... | 453 | 0 | 132 |
0245172c85b78f4f4335204005de051e5effb0d9 | 9,361 | py | Python | TraceGenerator.py | tgale96/memory-address-trace-tools | 0087dea8764944a9bb20868badbc10cb6066cc27 | [
"MIT"
] | 1 | 2021-02-10T02:02:20.000Z | 2021-02-10T02:02:20.000Z | TraceGenerator.py | tgale96/memory-address-trace-tools | 0087dea8764944a9bb20868badbc10cb6066cc27 | [
"MIT"
] | null | null | null | TraceGenerator.py | tgale96/memory-address-trace-tools | 0087dea8764944a9bb20868badbc10cb6066cc27 | [
"MIT"
] | null | null | null | """ filename: TraceGenerator.py
contents: this script calls the GenerateSyntheticTrace method that
creates and stream of memory references that models the memory
performance of the input application or applications
author: Trevor Gale
date: 3.4.16"""
import h5py as h5
import numpy as np
import... | 37.444 | 123 | 0.649824 | """ filename: TraceGenerator.py
contents: this script calls the GenerateSyntheticTrace method that
creates and stream of memory references that models the memory
performance of the input application or applications
author: Trevor Gale
date: 3.4.16"""
import h5py as h5
import numpy as np
import... | 0 | 0 | 0 |
8d9f7ecbe7901669fd46fcdcbed2e71b21fe5538 | 1,337 | py | Python | src/read_data.py | oneguynick/battery_model | ee9fa1f04a060b3486d5a496760b47db70a91888 | [
"MIT"
] | 37 | 2018-12-05T15:31:13.000Z | 2022-02-14T14:54:19.000Z | src/read_data.py | xxl4tomxu98/Energy_Storage_Pyomo | fa7bec0d9bb7a2d30a96e8fbc2e8957ecddc234c | [
"MIT"
] | 1 | 2020-09-01T02:50:00.000Z | 2020-09-02T12:42:48.000Z | src/read_data.py | xxl4tomxu98/Energy_Storage_Pyomo | fa7bec0d9bb7a2d30a96e8fbc2e8957ecddc234c | [
"MIT"
] | 13 | 2018-11-08T17:18:11.000Z | 2021-06-01T16:21:50.000Z | import pandas as pd
def read_filter_lbmp(path):
"""
Read one csv file with pandas. Convert the Time Stamp field to pandas
datetime format. Filter out non-NYC nodes and only keep required columns.
Change column names to snake case for easier access.
Parameters
----------
path : str or ... | 26.74 | 77 | 0.613313 | import pandas as pd
def read_filter_lbmp(path):
"""
Read one csv file with pandas. Convert the Time Stamp field to pandas
datetime format. Filter out non-NYC nodes and only keep required columns.
Change column names to snake case for easier access.
Parameters
----------
path : str or ... | 0 | 0 | 0 |
c4d2c99a44409cf5bcbe81080d8b5c90242aef43 | 5,232 | py | Python | fdroid_dl/update/index.py | nicopace/fdroid-dl | 06f8f46b947a01ace5a69ce442b4195e5386953c | [
"MIT"
] | null | null | null | fdroid_dl/update/index.py | nicopace/fdroid-dl | 06f8f46b947a01ace5a69ce442b4195e5386953c | [
"MIT"
] | null | null | null | fdroid_dl/update/index.py | nicopace/fdroid-dl | 06f8f46b947a01ace5a69ce442b4195e5386953c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os.path
from concurrent.futures import as_completed
import requests
from ..download import FuturesSessionFlex
from ..processor import IndexFileProcessor
logger = logging.getLogger('update.IndexUpdate')
| 48.444444 | 184 | 0.613723 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os.path
from concurrent.futures import as_completed
import requests
from ..download import FuturesSessionFlex
from ..processor import IndexFileProcessor
logger = logging.getLogger('update.IndexUpdate')
class IndexUpdate:
def __init__(self,confi... | 4,751 | -3 | 210 |
a82d0971f1f41de5777dfa876b35ba155a2396c9 | 5,594 | py | Python | models.py | Arturs/udacity-computer_vision1 | 0d71428c6542f02a001565404e5235f51b19bf89 | [
"MIT"
] | null | null | null | models.py | Arturs/udacity-computer_vision1 | 0d71428c6542f02a001565404e5235f51b19bf89 | [
"MIT"
] | null | null | null | models.py | Arturs/udacity-computer_vision1 | 0d71428c6542f02a001565404e5235f51b19bf89 | [
"MIT"
] | null | null | null | ## TODO: define the convolutional neural network architecture
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
| 33.698795 | 117 | 0.555417 | ## TODO: define the convolutional neural network architecture
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net(nn.Module):
def ... | 5,209 | 0 | 100 |
04d9fcf1d8d76ecdd25982beaa26335f1e0641bd | 6,160 | py | Python | Robot.py | btrice/Robotics | 89e718a08ab50b6cf957b2766eea6d653b518802 | [
"Apache-2.0"
] | 1 | 2019-10-10T12:54:47.000Z | 2019-10-10T12:54:47.000Z | Robot.py | btrice/Robotics | 89e718a08ab50b6cf957b2766eea6d653b518802 | [
"Apache-2.0"
] | null | null | null | Robot.py | btrice/Robotics | 89e718a08ab50b6cf957b2766eea6d653b518802 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
import pygame
import sys
import random
def main ():
"""Main function"""
rt = Robot()
p = rt.init_probability_map()
while True:
#rt.display_robot()
rt.display_probability_map(p)
m = rt.robot_random_move()
rt.perception()
rt... | 30.49505 | 137 | 0.525325 | #! /usr/bin/env python
import pygame
import sys
import random
class Robot(object):
def __init__ (self):
self.pygame = pygame.init()
self.screen = pygame.display.set_mode((640,480))
self.x = random.randint(0,9) # robot x position
self.y = random.randint(0,9) # robot y position
... | 265 | 5,316 | 26 |
c9f18bb599d78b1a54d6f891a4ae00339b091379 | 6,010 | py | Python | geojson2java.py | Quar/AnyLogicGIS_from_geojson | 6037ae9b0480ff3e1ae16085baabec40d3425396 | [
"MIT"
] | 2 | 2018-06-18T15:27:45.000Z | 2019-11-23T00:16:32.000Z | geojson2java.py | Quar/AnyLogicGIS_from_geojson | 6037ae9b0480ff3e1ae16085baabec40d3425396 | [
"MIT"
] | 1 | 2019-09-16T05:35:51.000Z | 2019-09-16T05:35:51.000Z | geojson2java.py | Quar/AnyLogicGIS_from_geojson | 6037ae9b0480ff3e1ae16085baabec40d3425396 | [
"MIT"
] | null | null | null | import json
from io import StringIO
import argparse
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="""
Generate Java Utility class from GeoJson Input for AnyLogic GISShape
""")
parser.add_argument('geojsonfile',
help='path to geojson file of region... | 31.465969 | 142 | 0.59817 | import json
from io import StringIO
import argparse
def read_geo_obj(filepath):
with open(filepath, 'r') as f:
return json.load(f)
def print_key_trees(dict_obj):
def print_indent(obj, indent=0):
if isinstance(obj, dict):
for k, v in obj.items():
print('\t'*indent ... | 5,073 | 0 | 230 |
c36194f00baaa0b59faef27b4bff8f45286f8d6b | 469 | py | Python | conftest.py | DKE-Data/agrirouter-sdk-python | 6d6b26606f7d424c62289af56da55acf412772fc | [
"Apache-2.0"
] | null | null | null | conftest.py | DKE-Data/agrirouter-sdk-python | 6d6b26606f7d424c62289af56da55acf412772fc | [
"Apache-2.0"
] | null | null | null | conftest.py | DKE-Data/agrirouter-sdk-python | 6d6b26606f7d424c62289af56da55acf412772fc | [
"Apache-2.0"
] | null | null | null | import pytest
from tests.constants import public_key, private_key, auth_result_url
@pytest.fixture(scope="session")
| 33.5 | 85 | 0.80597 | import pytest
from tests.constants import public_key, private_key, auth_result_url
@pytest.fixture(scope="session")
def authorization():
from agrirouter.auth.auth import Authorization
auth_client = Authorization("QA", public_key=public_key, private_key=private_key)
auth_response = auth_client.extract_aut... | 329 | 0 | 22 |
71460bc2648ba173cb08db66055f0c4bfbe42333 | 471 | py | Python | tests/unittests/http_functions/sync_logging/main.py | gohar94/azure-functions-python-worker | 4322e53ddbcc1eea40c1b061b42653336d9003f6 | [
"MIT"
] | 277 | 2018-01-25T23:13:03.000Z | 2022-02-22T06:12:04.000Z | tests/unittests/http_functions/sync_logging/main.py | gohar94/azure-functions-python-worker | 4322e53ddbcc1eea40c1b061b42653336d9003f6 | [
"MIT"
] | 731 | 2018-01-18T18:54:38.000Z | 2022-03-29T00:01:46.000Z | tests/unittests/http_functions/sync_logging/main.py | YunchuWang/azure-functions-python-worker | 1f23e038a506c6412e4efbf07eb471a6afab0c2a | [
"MIT"
] | 109 | 2018-01-18T02:22:57.000Z | 2022-02-15T18:59:54.000Z | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import logging
import time
import azure.functions
logger = logging.getLogger('my function')
| 23.55 | 74 | 0.711253 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import logging
import time
import azure.functions
logger = logging.getLogger('my function')
def main(req: azure.functions.HttpRequest):
try:
1 / 0
except ZeroDivisionError:
logger.error('a graceful... | 258 | 0 | 23 |
4a90ef174f0f3934bc571093ee16d87145d07aa4 | 1,050 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/urls.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/urls.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/common/djangoapps/third_party_auth/urls.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """Url configuration for the auth module."""
from django.conf.urls import include, url
from .views import (
IdPRedirectView,
inactive_user_view,
lti_login_and_complete_view,
post_to_custom_auth_form,
saml_metadata_view
)
urlpatterns = [
url(r'^auth/inactive', inactive_user_view, name="third_p... | 43.75 | 105 | 0.74 | """Url configuration for the auth module."""
from django.conf.urls import include, url
from .views import (
IdPRedirectView,
inactive_user_view,
lti_login_and_complete_view,
post_to_custom_auth_form,
saml_metadata_view
)
urlpatterns = [
url(r'^auth/inactive', inactive_user_view, name="third_p... | 0 | 0 | 0 |
4eeaa2e94ebf0366cc4aae0128164fc2f00bbf83 | 9,991 | py | Python | maltpynt/rebin.py | matteobachetti/MaLTPyNT | 6c93d2e23041b6c932810b5a8d727ee1b6dabfed | [
"BSD-3-Clause"
] | 8 | 2015-02-23T13:43:21.000Z | 2021-07-17T11:35:24.000Z | maltpynt/rebin.py | matteobachetti/MaLTPyNT | 6c93d2e23041b6c932810b5a8d727ee1b6dabfed | [
"BSD-3-Clause"
] | 1 | 2017-09-14T07:55:07.000Z | 2017-09-14T07:55:07.000Z | maltpynt/rebin.py | matteobachetti/MaLTPyNT | 6c93d2e23041b6c932810b5a8d727ee1b6dabfed | [
"BSD-3-Clause"
] | 4 | 2016-03-02T20:36:07.000Z | 2018-02-26T13:23:53.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to rebin light curves and frequency spectra."""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from .io import get_file_type
from .io import save_data
from .io i... | 32.333333 | 78 | 0.572315 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions to rebin light curves and frequency spectra."""
from __future__ import (absolute_import, unicode_literals, division,
print_function)
import numpy as np
from .io import get_file_type
from .io import save_data
from .io i... | 0 | 0 | 0 |
17f3c7f78e01745f6b3482cefe947cc17063b57b | 2,435 | py | Python | python/companies_plugin-1.21/companies_plugin/utils/sys_utils.py | dataesr/scanr-backend | 39681be69b9a96b4a07b9410754c897cd5b65c24 | [
"MIT"
] | null | null | null | python/companies_plugin-1.21/companies_plugin/utils/sys_utils.py | dataesr/scanr-backend | 39681be69b9a96b4a07b9410754c897cd5b65c24 | [
"MIT"
] | 3 | 2020-06-18T15:06:10.000Z | 2021-05-07T16:29:50.000Z | plugins/companies_plugin/companies_plugin/utils/sys_utils.py | reseachalps/Search-Engine | 1cd1e83902119938ffd412394b09dce92d082500 | [
"MIT"
] | null | null | null | import faulthandler
import atexit
import signal
import traceback
import os
import multiprocessing
# To test with doctest...
if not __package__: # pragma: no cover
LIB_PATH = "."
else:
from .. import LIB_PATH
# Global configuration
DUMP_DIRECTORY = LIB_PATH + "/dump/"
DUMP_CURRENT_PROCESS = DUMP_DIRECTORY + ... | 31.623377 | 110 | 0.643121 | import faulthandler
import atexit
import signal
import traceback
import os
import multiprocessing
# To test with doctest...
if not __package__: # pragma: no cover
LIB_PATH = "."
else:
from .. import LIB_PATH
# Global configuration
DUMP_DIRECTORY = LIB_PATH + "/dump/"
DUMP_CURRENT_PROCESS = DUMP_DIRECTORY + ... | 960 | 0 | 53 |
4c9227643a202094fb84db7b27faaa285c006aab | 4,370 | py | Python | IcebergCalculations.py | helenamorgan/WhiteStarLine | fea59659de10d1d192beb1543b82de43098b2c7d | [
"MIT"
] | null | null | null | IcebergCalculations.py | helenamorgan/WhiteStarLine | fea59659de10d1d192beb1543b82de43098b2c7d | [
"MIT"
] | null | null | null | IcebergCalculations.py | helenamorgan/WhiteStarLine | fea59659de10d1d192beb1543b82de43098b2c7d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 7 11:32:58 2021
@author: helena
"""
class IcebergCalc():
"""
Class declaration for the IcebergCalc class.
Provides methods for calculating an iceberg's area, volume and mass.
"""
def __init__(self, lidardata, radardata, seaice_m):
"... | 30.774648 | 189 | 0.559497 | # -*- coding: utf-8 -*-
"""
Created on Fri May 7 11:32:58 2021
@author: helena
"""
class IcebergCalc():
"""
Class declaration for the IcebergCalc class.
Provides methods for calculating an iceberg's area, volume and mass.
"""
def __init__(self, lidardata, radardata, seaice_m):
"... | 0 | 0 | 0 |
7eb8517b615d71c48f5f7c34f233991231b9648f | 6,502 | py | Python | keras_mobile/blocks/conv.py | i404788/keras-mobile | db48cb9a3b63cfda5d8edd2749c3eb17661ef8d4 | [
"MIT"
] | 1 | 2019-09-30T10:37:22.000Z | 2019-09-30T10:37:22.000Z | keras_mobile/blocks/conv.py | i404788/keras-mobile | db48cb9a3b63cfda5d8edd2749c3eb17661ef8d4 | [
"MIT"
] | null | null | null | keras_mobile/blocks/conv.py | i404788/keras-mobile | db48cb9a3b63cfda5d8edd2749c3eb17661ef8d4 | [
"MIT"
] | null | null | null | from keras.layers import Conv2D, BatchNormalization, Input, DepthwiseConv2D, Lambda, Concatenate
from keras.layers import GlobalAveragePooling2D, Reshape, ReLU, Add, Dropout
import keras.backend as K
from ..functions.mutations import channel_split, channel_shuffle
# Emulate class behaviour for parameterization
def S... | 32.348259 | 106 | 0.563211 | from keras.layers import Conv2D, BatchNormalization, Input, DepthwiseConv2D, Lambda, Concatenate
from keras.layers import GlobalAveragePooling2D, Reshape, ReLU, Add, Dropout
import keras.backend as K
from ..functions.mutations import channel_split, channel_shuffle
# Emulate class behaviour for parameterization
def S... | 3,385 | 0 | 179 |
7cf87342ec75cba52f90005f86e21e0e03f234af | 41 | py | Python | tests/_support/configs/python/invoke.py | daobook/invoke | 577faf1c016a69392583046613bfb42356855e8f | [
"BSD-2-Clause"
] | null | null | null | tests/_support/configs/python/invoke.py | daobook/invoke | 577faf1c016a69392583046613bfb42356855e8f | [
"BSD-2-Clause"
] | null | null | null | tests/_support/configs/python/invoke.py | daobook/invoke | 577faf1c016a69392583046613bfb42356855e8f | [
"BSD-2-Clause"
] | null | null | null | outer = {"inner": {"hooray": "python"}}
| 20.5 | 40 | 0.536585 | outer = {"inner": {"hooray": "python"}}
| 0 | 0 | 0 |
82cb4d5dd9061a4bb4f537e15e18859ca7f1c372 | 601 | py | Python | multi_user.py | rithikrice/Whatsapp_auto_2 | 3e00988b5d8725e6bb3b3039a7bb56308ccfe714 | [
"MIT"
] | 1 | 2019-08-04T20:12:00.000Z | 2019-08-04T20:12:00.000Z | multi_user.py | rithikrice/Whatsapp_auto_2 | 3e00988b5d8725e6bb3b3039a7bb56308ccfe714 | [
"MIT"
] | null | null | null | multi_user.py | rithikrice/Whatsapp_auto_2 | 3e00988b5d8725e6bb3b3039a7bb56308ccfe714 | [
"MIT"
] | 1 | 2020-03-02T22:24:18.000Z | 2020-03-02T22:24:18.000Z | from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://web.whatsapp.com/')
all_names = ['Sachin Yadav']
msg = input('Enter the message')
count = int(input('no.of times to send message'))
input('click any random key after qr scanning')
for name in all_names:
user = driver.find... | 28.619048 | 78 | 0.663894 | from selenium import webdriver
driver = webdriver.Chrome()
driver.get('https://web.whatsapp.com/')
all_names = ['Sachin Yadav']
msg = input('Enter the message')
count = int(input('no.of times to send message'))
input('click any random key after qr scanning')
for name in all_names:
user = driver.find... | 0 | 0 | 0 |
7e6cbc5d15b6db6d05cc1a9bb65b6ab33e786060 | 1,626 | py | Python | iogt_users/wagtail_hooks.py | saqlainrasheed/iogt | 4bebfe4cd2f1d4ff9cab50d1126756c162a30b89 | [
"BSD-2-Clause"
] | 1 | 2021-11-18T05:10:14.000Z | 2021-11-18T05:10:14.000Z | iogt_users/wagtail_hooks.py | mbilalhameed/iogt | 9c12f0be29f1eea0097ec43f692c77ba65673610 | [
"BSD-2-Clause"
] | null | null | null | iogt_users/wagtail_hooks.py | mbilalhameed/iogt | 9c12f0be29f1eea0097ec43f692c77ba65673610 | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils import timezone
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from home.models import SiteSettings
from iogt_users.filters import GroupsFilter
modeladmin_register(UsersExportAdmin)
| 41.692308 | 109 | 0.740467 | from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils import timezone
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from home.models import SiteSettings
from iogt_users.filters import GroupsFilter
class UsersExportAdmin(ModelAdmin):
mod... | 549 | 738 | 23 |
8222c146252aa8643f4d57a50a367425f145b298 | 985 | py | Python | aioethereum/utils.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 16 | 2017-10-04T17:44:51.000Z | 2021-03-07T12:55:04.000Z | aioethereum/utils.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 8 | 2017-10-04T22:53:08.000Z | 2021-01-15T18:04:41.000Z | aioethereum/utils.py | h8is2w8/aioethereum | eb23e28068c34cda28bbef45c3f288d16936d88e | [
"MIT"
] | 5 | 2018-02-22T15:56:34.000Z | 2021-01-03T21:25:22.000Z | from .constants import BLOCK_TAGS
def add_0x(string):
"""Add 0x to string at start.
"""
if isinstance(string, bytes):
string = string.decode('utf-8')
return '0x' + str(string)
def hex_to_dec(x):
"""Convert hex to decimal
"""
return int(x, 16)
def wei_to_ether(wei):
"""Conve... | 18.584906 | 50 | 0.592893 | from .constants import BLOCK_TAGS
def add_0x(string):
"""Add 0x to string at start.
"""
if isinstance(string, bytes):
string = string.decode('utf-8')
return '0x' + str(string)
def hex_to_dec(x):
"""Convert hex to decimal
"""
return int(x, 16)
def wei_to_ether(wei):
"""Conve... | 0 | 0 | 0 |
d93321b1077efe4ccc8a70aaaa794d1456e0dc6a | 192 | py | Python | fle_site/apps/redirects/context_processors.py | khangmach/fle-home | 42c376bc9aca5a440a09e78973ea1b48a0827e3c | [
"MIT"
] | null | null | null | fle_site/apps/redirects/context_processors.py | khangmach/fle-home | 42c376bc9aca5a440a09e78973ea1b48a0827e3c | [
"MIT"
] | null | null | null | fle_site/apps/redirects/context_processors.py | khangmach/fle-home | 42c376bc9aca5a440a09e78973ea1b48a0827e3c | [
"MIT"
] | null | null | null | from .models import RedirectVariable
| 27.428571 | 106 | 0.666667 | from .models import RedirectVariable
def redirect_vars(request):
return {
'vars': dict([tuple(r.values()) for r in RedirectVariable.objects.all().values("name", "value")]),
}
| 132 | 0 | 23 |
c92a4fae037b23367735659e7e8606b589d6c871 | 1,911 | py | Python | pybw/tokens.py | louisdevie/birdway | fc71ab4deaa154033cd3228746919e6e82c4723f | [
"CC0-1.0"
] | null | null | null | pybw/tokens.py | louisdevie/birdway | fc71ab4deaa154033cd3228746919e6e82c4723f | [
"CC0-1.0"
] | null | null | null | pybw/tokens.py | louisdevie/birdway | fc71ab4deaa154033cd3228746919e6e82c4723f | [
"CC0-1.0"
] | null | null | null | from enum import Enum, auto
from autorepr import AutoRepr
from birdway import Unary, Type, Binary
for name in [
"KeywordMeta",
"KeywordArgs",
"KeywordParam",
"KeywordRun",
"KeywordIf",
"KeywordThen",
"KeywordElse",
"KeywordPrintln",
"KeywordOption",
"BlockBegin",
"BlockEnd... | 20.329787 | 69 | 0.579278 | from enum import Enum, auto
from autorepr import AutoRepr
from birdway import Unary, Type, Binary
class Token:
def __init__(self, line=None, **attributes):
self._line = line
for attr in dir(self):
if not attr.startswith("_"):
if attr in attributes:
s... | 599 | 223 | 237 |
ca7b5cebd80d5aca1a160db747c842eb5e4be84f | 1,643 | py | Python | adventofcode/code_7.py | fearless-spider/python_playground | 5150b2de09736d68558f4c159e110a7ebbe29bfc | [
"BSD-3-Clause"
] | null | null | null | adventofcode/code_7.py | fearless-spider/python_playground | 5150b2de09736d68558f4c159e110a7ebbe29bfc | [
"BSD-3-Clause"
] | null | null | null | adventofcode/code_7.py | fearless-spider/python_playground | 5150b2de09736d68558f4c159e110a7ebbe29bfc | [
"BSD-3-Clause"
] | null | null | null | file1 = open('input_7.txt', 'r')
Lines = file1.readlines()
bingo_numbers = Lines[0].split(",")
bingo_tables = []
bingo_win = 0
bingo_row_number = 0
for line in Lines[2:]:
new_row = []
if line == '\n':
continue
row = line.split(" ")
for element in row:
if element == '\n' or element == ''... | 27.383333 | 61 | 0.529519 | file1 = open('input_7.txt', 'r')
Lines = file1.readlines()
bingo_numbers = Lines[0].split(",")
bingo_tables = []
bingo_win = 0
bingo_row_number = 0
for line in Lines[2:]:
new_row = []
if line == '\n':
continue
row = line.split(" ")
for element in row:
if element == '\n' or element == ''... | 0 | 0 | 0 |
57baad10af5b26c0c3e29aeccdf74f93c7ca4346 | 103 | py | Python | user_input.py | NathanKr/python-playground | 03ea7f6489ab4db84c8180332a2ebf07caa9136e | [
"MIT"
] | null | null | null | user_input.py | NathanKr/python-playground | 03ea7f6489ab4db84c8180332a2ebf07caa9136e | [
"MIT"
] | null | null | null | user_input.py | NathanKr/python-playground | 03ea7f6489ab4db84c8180332a2ebf07caa9136e | [
"MIT"
] | null | null | null | username = input("Please enter your name : ")
print(type(username))
print(f'Your name is : {username}') | 34.333333 | 45 | 0.708738 | username = input("Please enter your name : ")
print(type(username))
print(f'Your name is : {username}') | 0 | 0 | 0 |
65abe0016207dd33ebabe1cf568609bc06ca94ca | 9,175 | py | Python | FileCrypt/__init__.py | TA40/FileCryptcc | f6f7144a0204c5141fa7f12f91b112d6db8f2b96 | [
"MIT"
] | 4 | 2019-07-03T00:32:57.000Z | 2021-03-08T17:14:19.000Z | FileCrypt/__init__.py | TA40/FileCryptcc | f6f7144a0204c5141fa7f12f91b112d6db8f2b96 | [
"MIT"
] | null | null | null | FileCrypt/__init__.py | TA40/FileCryptcc | f6f7144a0204c5141fa7f12f91b112d6db8f2b96 | [
"MIT"
] | null | null | null | import requests, json
def userApiKey(apikey):
"""
Returns information about an apikey
apikey: Your ApiKey from FileCrypt
Attention: this API is limited to 10 requests for an timeframe of 1 hour.
"""
data={"api_key":apikey,"sub":"apikey","fn":"user"}
return json.loads(requests.post("https://filecrypt... | 38.55042 | 173 | 0.685014 | import requests, json
def userApiKey(apikey):
"""
Returns information about an apikey
apikey: Your ApiKey from FileCrypt
Attention: this API is limited to 10 requests for an timeframe of 1 hour.
"""
data={"api_key":apikey,"sub":"apikey","fn":"user"}
return json.loads(requests.post("https://filecrypt... | 0 | 0 | 0 |
222bffa1cd27cddad2aa20e2e4bec46c065c5610 | 363 | py | Python | pintest.py | PHSCRC/NotHotBot | 651671d5df263fe82debc264c4e74b598ed15252 | [
"MIT"
] | 1 | 2018-03-26T18:24:54.000Z | 2018-03-26T18:24:54.000Z | pintest.py | PHSCRC/NotHotBot | 651671d5df263fe82debc264c4e74b598ed15252 | [
"MIT"
] | null | null | null | pintest.py | PHSCRC/NotHotBot | 651671d5df263fe82debc264c4e74b598ed15252 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import sys
import time
if __name__ == '__main__':
main(int(sys.argv[1]))
| 18.15 | 60 | 0.658402 | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import sys
import time
def callback(pin):
out = GPIO.input(pin)
print(pin, out)
def main(pin):
GPIO.setmode(GPIO.BCM)
GPIO.setup(pin, GPIO.IN)
GPIO.add_event_detect(pin, GPIO.BOTH, callback=callback)
while True:
time.sleep(1)
if __name__... | 191 | 0 | 46 |
217a23271cf0e977d97d4f30363fd22f97b7adfe | 1,864 | py | Python | catalog/pub/redisco/__init__.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 4 | 2018-08-29T02:51:38.000Z | 2021-11-16T11:36:11.000Z | catalog/pub/redisco/__init__.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | null | null | null | catalog/pub/redisco/__init__.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 1 | 2019-05-12T08:21:19.000Z | 2019-05-12T08:21:19.000Z | # Copyright (c) 2010 Tim Medina
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, ... | 31.59322 | 95 | 0.724785 | # Copyright (c) 2010 Tim Medina
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, merge, publish, ... | 391 | 0 | 149 |
5ed524bfc8f2e68a9f52c920340176e1a1192143 | 309 | py | Python | app/models.py | sundaming/flask_pure | 940dcb8eaeff43bb93445bec436542c8fdd28d27 | [
"MIT"
] | 143 | 2015-05-12T05:09:22.000Z | 2022-01-24T15:46:36.000Z | app/models.py | sundaming/flask_pure | 940dcb8eaeff43bb93445bec436542c8fdd28d27 | [
"MIT"
] | 1 | 2016-06-03T13:59:50.000Z | 2016-12-02T03:15:57.000Z | app/models.py | sundaming/flask_pure | 940dcb8eaeff43bb93445bec436542c8fdd28d27 | [
"MIT"
] | 73 | 2015-07-02T05:07:43.000Z | 2020-10-08T07:18:48.000Z | from app import db
import datetime
| 30.9 | 60 | 0.734628 | from app import db
import datetime
class Post(db.Document):
author = db.StringField(max_length=50)
title = db.StringField(max_length=120, required=True)
tags = db.ListField(db.StringField(max_length=30))
time = db.DateTimeField(default=datetime.datetime.now())
content = db.StringField()
| 0 | 251 | 23 |
ec66bc66f993ab1a980149e8ee9e58421317a060 | 420 | py | Python | backend/src/resource/randoms.py | myang81/Degree_Project | 4535f8a45148e3d6d061d0ddbca9cd94d995d42f | [
"MIT"
] | 1 | 2021-03-28T14:16:03.000Z | 2021-03-28T14:16:03.000Z | backend/src/resource/randoms.py | myang81/Degree_Project | 4535f8a45148e3d6d061d0ddbca9cd94d995d42f | [
"MIT"
] | null | null | null | backend/src/resource/randoms.py | myang81/Degree_Project | 4535f8a45148e3d6d061d0ddbca9cd94d995d42f | [
"MIT"
] | null | null | null |
import numpy as np
import random
import xlwt
#
# 市界的地理坐标为:北纬39”26’至41”03’,东经115”25’至 117”30’
workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet("My Workbook")
print(worksheet)
a=[]
for i in range(0,5107):
x=random.uniform(115,117)
y=random.uniform(39,41)
a.append(str(
( st... | 16.153846 | 45 | 0.654762 |
import numpy as np
import random
import xlwt
#
# 市界的地理坐标为:北纬39”26’至41”03’,东经115”25’至 117”30’
workbook = xlwt.Workbook(encoding='utf-8')
worksheet = workbook.add_sheet("My Workbook")
print(worksheet)
a=[]
for i in range(0,5107):
x=random.uniform(115,117)
y=random.uniform(39,41)
a.append(str(
( st... | 0 | 0 | 0 |
3863c5d84e88b51b65a954ee08415339f58f5ec8 | 2,640 | py | Python | statsmodels/compatnp/iter_compat.py | toobaz/statsmodels | 5286dd713a809b0630232508bf9ad5104aae1980 | [
"BSD-3-Clause"
] | 2 | 2017-01-05T22:44:37.000Z | 2018-04-26T08:34:00.000Z | statsmodels/compatnp/iter_compat.py | AnaMP/statsmodels | 2d4aad9a14619ce0c84d4c7bca9dacd66b2be566 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/compatnp/iter_compat.py | AnaMP/statsmodels | 2d4aad9a14619ce0c84d4c7bca9dacd66b2be566 | [
"BSD-3-Clause"
] | 1 | 2017-05-12T09:51:44.000Z | 2017-05-12T09:51:44.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 29 10:12:38 2012
Author: Josef Perktold
License: BSD-3
"""
import itertools
try:
#python 2.6, 2.7
zip_longest = itertools.izip_longest
pass
except AttributeError:
#python 3.2
try:
zip_longest = itertools.zip_longest
pass
except ... | 30 | 84 | 0.481818 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 29 10:12:38 2012
Author: Josef Perktold
License: BSD-3
"""
import itertools
try:
#python 2.6, 2.7
zip_longest = itertools.izip_longest
pass
except AttributeError:
#python 3.2
try:
zip_longest = itertools.zip_longest
pass
except ... | 736 | 0 | 60 |
b0da74a3faec35ede730e6192678e7ff370057e5 | 4,119 | py | Python | tutorials/mobilenetv3_prod/Step1-5/05_test_backward.py | leiqing1/models | 33aa4e7ec09a0c210b182dec7aec8ff3bbda45e3 | [
"Apache-2.0"
] | 7,090 | 2017-04-21T00:22:09.000Z | 2022-03-31T11:52:40.000Z | tutorials/mobilenetv3_prod/Step1-5/05_test_backward.py | leiqing1/models | 33aa4e7ec09a0c210b182dec7aec8ff3bbda45e3 | [
"Apache-2.0"
] | 2,601 | 2017-04-21T02:52:04.000Z | 2022-03-09T08:43:09.000Z | tutorials/mobilenetv3_prod/Step1-5/05_test_backward.py | leiqing1/models | 33aa4e7ec09a0c210b182dec7aec8ff3bbda45e3 | [
"Apache-2.0"
] | 3,391 | 2017-04-21T00:22:19.000Z | 2022-03-30T17:53:25.000Z | import paddle
import numpy as np
import torch
import torch.optim.lr_scheduler as lr_scheduler
from reprod_log import ReprodLogger
from reprod_log import ReprodDiffHelper
from mobilenetv3_paddle.paddlevision.models import mobilenet_v3_small as mv3_small_paddle
from mobilenetv3_ref.torchvision.models import mobilenet_v3... | 33.762295 | 89 | 0.667881 | import paddle
import numpy as np
import torch
import torch.optim.lr_scheduler as lr_scheduler
from reprod_log import ReprodLogger
from reprod_log import ReprodDiffHelper
from mobilenetv3_paddle.paddlevision.models import mobilenet_v3_small as mv3_small_paddle
from mobilenetv3_ref.torchvision.models import mobilenet_v3... | 3,308 | 0 | 69 |
66090fc039d6b9801a2c41c0d0b537b7e123ca6c | 4,302 | py | Python | Resaltador Paralelo/Carpeta1/Carpeta1-2/mejorracional.py | erteck/textHighlighter | 9f079d81b16acbd98a4f5f8520e43bef483d0071 | [
"MIT"
] | null | null | null | Resaltador Paralelo/Carpeta1/Carpeta1-2/mejorracional.py | erteck/textHighlighter | 9f079d81b16acbd98a4f5f8520e43bef483d0071 | [
"MIT"
] | null | null | null | Resaltador Paralelo/Carpeta1/Carpeta1-2/mejorracional.py | erteck/textHighlighter | 9f079d81b16acbd98a4f5f8520e43bef483d0071 | [
"MIT"
] | null | null | null | # ----------------------------------------------------------
#Erick Alberto Bustos Cruz A01378966
#
#
# ----------------------------------------------------------
from functools import total_ordering
import math as m
@total_ordering
class Racional:
"""Instancias de esta clase representan números
racionales ... | 36.769231 | 121 | 0.653649 | # ----------------------------------------------------------
#Erick Alberto Bustos Cruz A01378966
#
#
# ----------------------------------------------------------
from functools import total_ordering
import math as m
@total_ordering
class Racional:
"""Instancias de esta clase representan números
racionales ... | 3,345 | 0 | 493 |
85f74b093fce2b393c1d5630945f304dc90ef82f | 13,422 | py | Python | src/neural_networks.py | HinanawiTS/ECE-143-Project | b23c85d4815943b284a4275f10f0a73f77d1c038 | [
"Apache-2.0"
] | null | null | null | src/neural_networks.py | HinanawiTS/ECE-143-Project | b23c85d4815943b284a4275f10f0a73f77d1c038 | [
"Apache-2.0"
] | null | null | null | src/neural_networks.py | HinanawiTS/ECE-143-Project | b23c85d4815943b284a4275f10f0a73f77d1c038 | [
"Apache-2.0"
] | 1 | 2021-11-05T23:10:30.000Z | 2021-11-05T23:10:30.000Z | import numpy as np
import pandas as pd
import json
from mplsoccer.pitch import Pitch, VerticalPitch
path = "C:/Users/brand/desktop/events/events_England.json"
with open(path) as f:
data = json.load(f)
train = pd.DataFrame(data)
path2 = "C:/Users/brand/desktop/players.json"
with open(path... | 24.855556 | 130 | 0.629116 | import numpy as np
import pandas as pd
import json
from mplsoccer.pitch import Pitch, VerticalPitch
path = "C:/Users/brand/desktop/events/events_England.json"
with open(path) as f:
data = json.load(f)
train = pd.DataFrame(data)
path2 = "C:/Users/brand/desktop/players.json"
with open(path... | 1,709 | 0 | 75 |
e78e172f5ecee98c80457e5fc00170c7e563ca2f | 4,202 | py | Python | bce/parser/interface/molecule_parser.py | bce-toolkit/BCE | 9e4d168cab18132bbe2867d13c629510b86d350a | [
"BSD-3-Clause"
] | 12 | 2017-12-18T10:37:52.000Z | 2021-11-28T07:08:46.000Z | bce/parser/interface/molecule_parser.py | bce-toolkit/BCE | 9e4d168cab18132bbe2867d13c629510b86d350a | [
"BSD-3-Clause"
] | null | null | null | bce/parser/interface/molecule_parser.py | bce-toolkit/BCE | 9e4d168cab18132bbe2867d13c629510b86d350a | [
"BSD-3-Clause"
] | 4 | 2018-04-29T10:32:26.000Z | 2021-07-13T08:17:36.000Z | #!/usr/bin/env python
#
# Copyright 2014 - 2018 The BCE Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the license.txt file.
#
import bce.parser.interface.printer as _interface_printer
class SubstituteError(Exception):
"""Molecule substitution... | 36.224138 | 109 | 0.673489 | #!/usr/bin/env python
#
# Copyright 2014 - 2018 The BCE Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the license.txt file.
#
import bce.parser.interface.printer as _interface_printer
class SubstituteError(Exception):
"""Molecule substitution... | 0 | 0 | 0 |
18c1f8b7670e262a0bc985665281839f28f37ed9 | 12,407 | py | Python | moto/config/exceptions.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | moto/config/exceptions.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | moto/config/exceptions.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | from moto.core.exceptions import JsonRESTError
class NoSuchBucketException(JsonRESTError):
"""We are *only* validating that there is value that is not '' here."""
code = 400
class InvalidSNSTopicARNException(JsonRESTError):
"""We are *only* validating that there is value that is not '' here."... | 30.334963 | 123 | 0.650923 | from moto.core.exceptions import JsonRESTError
class NameTooLongException(JsonRESTError):
code = 400
def __init__(self, name, location, max_limit=256):
message = (
f"1 validation error detected: Value '{name}' at '{location}' "
f"failed to satisfy constraint: Member must have ... | 8,493 | 2,643 | 905 |
343d6f9567caad37d311aa09d840dc694a588fef | 1,836 | py | Python | generators.py | sichkar-valentyn/Generators_in_Python | c8cb66960fc8f6e253cb4076dfaa440b7eb06503 | [
"MIT"
] | null | null | null | generators.py | sichkar-valentyn/Generators_in_Python | c8cb66960fc8f6e253cb4076dfaa440b7eb06503 | [
"MIT"
] | null | null | null | generators.py | sichkar-valentyn/Generators_in_Python | c8cb66960fc8f6e253cb4076dfaa440b7eb06503 | [
"MIT"
] | null | null | null | # File: generators.py
# Description: Examples on how to create and use generators in Python
# Environment: PyCharm and Anaconda environment
#
# MIT License
# Copyright (c) 2018 Valentyn N Sichkar
# github.com/sichkar-valentyn
#
# Reference to:
# [1] Valentyn N Sichkar. Examples on how to create and use generators in Py... | 21.103448 | 213 | 0.638889 | # File: generators.py
# Description: Examples on how to create and use generators in Python
# Environment: PyCharm and Anaconda environment
#
# MIT License
# Copyright (c) 2018 Valentyn N Sichkar
# github.com/sichkar-valentyn
#
# Reference to:
# [1] Valentyn N Sichkar. Examples on how to create and use generators in Py... | 604 | 0 | 191 |
705d98e1ed46727a93b0c67d7b1e53f1efab3221 | 25,439 | py | Python | src/UniData.py | bazilinskyy/agent-based-uni | a8a5086a9d012e6cd972cf58c7865463b5e6f9b3 | [
"MIT"
] | null | null | null | src/UniData.py | bazilinskyy/agent-based-uni | a8a5086a9d012e6cd972cf58c7865463b5e6f9b3 | [
"MIT"
] | null | null | null | src/UniData.py | bazilinskyy/agent-based-uni | a8a5086a9d012e6cd972cf58c7865463b5e6f9b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Loading data from Excel files stored at /src/data.
"""
# Copyright (c) 2014, Pavlo Bazilinskyy <pavlo.bazilinskyy@gmail.com>
# Department of Computer Science, National University of Ireland, Maynooth
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this sof... | 41.096931 | 147 | 0.671056 | #!/usr/bin/env python
"""
Loading data from Excel files stored at /src/data.
"""
# Copyright (c) 2014, Pavlo Bazilinskyy <pavlo.bazilinskyy@gmail.com>
# Department of Computer Science, National University of Ireland, Maynooth
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this sof... | 22,651 | 1,112 | 23 |
8193d1da13031328c8e781646be0da0dbfa4d864 | 346 | py | Python | projeto_labhacker/core/urls.py | thiagonf/prova-labhacker | c6cf3bbc89f5af16e9d784b53e0787a71e2ab292 | [
"MIT"
] | null | null | null | projeto_labhacker/core/urls.py | thiagonf/prova-labhacker | c6cf3bbc89f5af16e9d784b53e0787a71e2ab292 | [
"MIT"
] | 7 | 2020-06-05T22:40:01.000Z | 2022-02-10T09:51:52.000Z | projeto_labhacker/core/urls.py | thiagonf/prova-labhacker | c6cf3bbc89f5af16e9d784b53e0787a71e2ab292 | [
"MIT"
] | null | null | null | from django.urls import path, include
from django.contrib import admin
from django.contrib.auth import views
from authentication.views import HomeView
urlpatterns = [
path('admin/', admin.site.urls),
path('', HomeView.as_view(), name='home'),
path('auth/', include('authentication.urls')),
path('', incl... | 28.833333 | 50 | 0.708092 | from django.urls import path, include
from django.contrib import admin
from django.contrib.auth import views
from authentication.views import HomeView
urlpatterns = [
path('admin/', admin.site.urls),
path('', HomeView.as_view(), name='home'),
path('auth/', include('authentication.urls')),
path('', incl... | 0 | 0 | 0 |
c22e4ba0798f0669fe19d69f6312a8620bb1d30a | 47 | py | Python | arbitrary_dateparser/__init__.py | nottheswimmer/abstract-dateparser | e8c6085f2db610bb36e8807e0248c4b310e9599e | [
"MIT"
] | 1 | 2019-08-02T21:36:14.000Z | 2019-08-02T21:36:14.000Z | arbitrary_dateparser/__init__.py | nottheswimmer/abstract-dateparser | e8c6085f2db610bb36e8807e0248c4b310e9599e | [
"MIT"
] | 1 | 2019-08-13T15:49:39.000Z | 2019-08-14T11:29:20.000Z | arbitrary_dateparser/__init__.py | nottheswimmer/abstract-dateparser | e8c6085f2db610bb36e8807e0248c4b310e9599e | [
"MIT"
] | null | null | null | from arbitrary_dateparser.dateparser import *
| 23.5 | 46 | 0.851064 | from arbitrary_dateparser.dateparser import *
| 0 | 0 | 0 |
ca737514e4cb0068974995165c48326b7ef7ffb8 | 3,895 | py | Python | tests/src/pat_LO_Table/check_catogory_levels.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null | tests/src/pat_LO_Table/check_catogory_levels.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null | tests/src/pat_LO_Table/check_catogory_levels.py | JalajaTR/cQube | 6bf58ab25f0c36709630987ab730bbd5d9192c03 | [
"MIT"
] | null | null | null | import csv
import os
import time
from selenium.webdriver.support.select import Select
from Data.parameters import Data
from filenames import file_extention
from get_dir import pwd
from reuse_func import GetData
| 39.744898 | 86 | 0.622593 | import csv
import os
import time
from selenium.webdriver.support.select import Select
from Data.parameters import Data
from filenames import file_extention
from get_dir import pwd
from reuse_func import GetData
class Catagory_series():
def __init__(self,driver):
self.driver = driver
def viewbys_opt... | 3,548 | 3 | 130 |
fc8976d261902bb332c90666a49e82c71afea265 | 4,257 | py | Python | conf/example_apps/ObjectTracker/objectcontrole.py | chipsi007/appdaemon | 4eaf4cc9a9c9bd3f703014bd60730c65ed7bfb74 | [
"Apache-2.0"
] | 2 | 2018-10-01T10:09:16.000Z | 2018-12-25T20:03:48.000Z | conf/example_apps/ObjectTracker/objectcontrole.py | chipsi007/appdaemon | 4eaf4cc9a9c9bd3f703014bd60730c65ed7bfb74 | [
"Apache-2.0"
] | null | null | null | conf/example_apps/ObjectTracker/objectcontrole.py | chipsi007/appdaemon | 4eaf4cc9a9c9bd3f703014bd60730c65ed7bfb74 | [
"Apache-2.0"
] | 1 | 2021-05-09T00:28:23.000Z | 2021-05-09T00:28:23.000Z | ###########################################################################################
# #
# ObjectTracker 2.0 #
# ... | 73.396552 | 209 | 0.439276 | ###########################################################################################
# #
# ObjectTracker 2.0 #
# ... | 1,228 | 11 | 103 |
0055b398181444b5c296d52fa505b1604e04fe4d | 1,663 | py | Python | getmedia/face_mesh.py | yuanzhoulvpi2017/tiny_python | 0247ef6ce76eeb8219a6fd2a4b2c092dc62f89f7 | [
"MIT"
] | 34 | 2021-09-17T09:32:34.000Z | 2022-03-28T07:26:02.000Z | getmedia/face_mesh.py | luji1515/tiny_python | 5ff7921bd241bdd8dca695712f6e0666cc35527f | [
"MIT"
] | null | null | null | getmedia/face_mesh.py | luji1515/tiny_python | 5ff7921bd241bdd8dca695712f6e0666cc35527f | [
"MIT"
] | 27 | 2021-09-17T14:07:28.000Z | 2022-03-15T02:03:37.000Z | import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
# mp_drawing_styles = mp.solutions.drawing_styles
mp_face_mesh = mp.solutions.face_mesh
# for webcam input:
if __name__ == '__main__':
main()
| 32.607843 | 113 | 0.58629 | import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
# mp_drawing_styles = mp.solutions.drawing_styles
mp_face_mesh = mp.solutions.face_mesh
# for webcam input:
def main():
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=1)
cap = cv2.VideoCapture(0)
with mp_face_me... | 1,415 | 0 | 23 |
1df567ae3270fbc9ec71f1694fa6fa8978628cd5 | 2,510 | py | Python | src/CacheSim/CacheRow.py | andrewoconnell89/CS472_Project2 | 8846b1ad6ecdbe88406d994d9e396b4c6f2bf552 | [
"MIT"
] | null | null | null | src/CacheSim/CacheRow.py | andrewoconnell89/CS472_Project2 | 8846b1ad6ecdbe88406d994d9e396b4c6f2bf552 | [
"MIT"
] | null | null | null | src/CacheSim/CacheRow.py | andrewoconnell89/CS472_Project2 | 8846b1ad6ecdbe88406d994d9e396b4c6f2bf552 | [
"MIT"
] | null | null | null | # Designed by Andy OConnell <aoconnel@bu.edu> <andrewoconnell89@gmail.com>
class CacheRow(object):
"""This represents a row of cache.
Instance Variables
Slot : middle 4 bits
Valid : If the row is real data
Tag : left 4 Bits
Data : 16 Bytes of information from memory
Dirt... | 34.861111 | 74 | 0.323904 | # Designed by Andy OConnell <aoconnel@bu.edu> <andrewoconnell89@gmail.com>
class CacheRow(object):
"""This represents a row of cache.
Instance Variables
Slot : middle 4 bits
Valid : If the row is real data
Tag : left 4 Bits
Data : 16 Bytes of information from memory
Dirt... | 2,088 | 0 | 53 |
c7cc5935f3c8fcff3c7f90b35a1a3b5f5c1c9ae1 | 3,857 | py | Python | helpdesk/forms.py | bobbybabu007/django-simple-helpdesk | d507682e82808ba182736d33e26824dcad8d801f | [
"BSD-2-Clause"
] | 14 | 2016-10-11T21:29:32.000Z | 2021-09-21T13:51:16.000Z | helpdesk/forms.py | bobbybabu007/django-simple-helpdesk | d507682e82808ba182736d33e26824dcad8d801f | [
"BSD-2-Clause"
] | 7 | 2015-11-14T19:15:47.000Z | 2021-06-24T18:35:42.000Z | helpdesk/forms.py | bobbybabu007/django-simple-helpdesk | d507682e82808ba182736d33e26824dcad8d801f | [
"BSD-2-Clause"
] | 17 | 2015-06-01T17:35:58.000Z | 2021-09-11T22:01:19.000Z | from ckeditor.fields import RichTextFormField
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Count
from django.forms import ModelChoiceField
from django.utils.module_loading import import_string
from helpdesk.models import State, Comme... | 36.046729 | 110 | 0.667358 | from ckeditor.fields import RichTextFormField
from django import forms
from django.conf import settings
from django.contrib.auth.models import User
from django.db.models import Count
from django.forms import ModelChoiceField
from django.utils.module_loading import import_string
from helpdesk.models import State, Comme... | 1,926 | 1,328 | 214 |
50f97070acc1569e51c3cee3d2a264838a2d00e1 | 61,329 | py | Python | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | sdk/loganalytics/azure-mgmt-loganalytics/azure/mgmt/loganalytics/operations/workspaces_operations.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 47.764019 | 234 | 0.669634 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 15,513 | 0 | 325 |
89803101cd22e318a3f2888d7a654ab6d1db616b | 237 | py | Python | utils/file_related.py | ishine/ppg-vc | b59cb9862cf4b82a3bdb589950e25cab85fc9b03 | [
"Apache-2.0"
] | 133 | 2021-06-12T04:44:36.000Z | 2022-03-31T09:42:26.000Z | utils/file_related.py | zhouyh-jlu/ppg-vc | b59cb9862cf4b82a3bdb589950e25cab85fc9b03 | [
"Apache-2.0"
] | 20 | 2021-06-14T20:15:49.000Z | 2022-02-18T09:05:00.000Z | utils/file_related.py | zhouyh-jlu/ppg-vc | b59cb9862cf4b82a3bdb589950e25cab85fc9b03 | [
"Apache-2.0"
] | 41 | 2021-06-12T05:43:50.000Z | 2022-03-27T07:56:28.000Z | import numpy as np
import torch
| 21.545455 | 70 | 0.704641 | import numpy as np
import torch
def load_filepaths_and_text(filename, split="|"):
with open(filename, encoding='utf-8') as f:
filepaths_and_text = [line.strip().split(split) for line in f]
return filepaths_and_text
| 177 | 0 | 24 |
3e2e8941c27d3a24c5b1554248525566a0a63029 | 765 | py | Python | softlearning/scripts/console_scripts.py | hanglai/bmpo | d065cf195b942c3e534d4c789a0982e0ec09957c | [
"MIT"
] | 19 | 2020-09-02T05:58:09.000Z | 2021-08-23T11:03:00.000Z | softlearning/scripts/console_scripts.py | hanglai/bmpo | d065cf195b942c3e534d4c789a0982e0ec09957c | [
"MIT"
] | 4 | 2020-07-19T13:57:56.000Z | 2021-11-10T19:42:58.000Z | softlearning/scripts/console_scripts.py | apexrl/bmpo | d065cf195b942c3e534d4c789a0982e0ec09957c | [
"MIT"
] | 3 | 2020-09-28T11:21:24.000Z | 2020-12-28T23:27:25.000Z | """A command line interface that exposes softlearning examples to user.
run_example_* methods, which run the experiments by invoking
`tune.run_experiments` function.
"""
import click
import sys
sys.path.append('./')
from examples.instrument import run_example_local
@click.group()
@cli.command(
name='run... | 20.131579 | 71 | 0.754248 | """A command line interface that exposes softlearning examples to user.
run_example_* methods, which run the experiments by invoking
`tune.run_experiments` function.
"""
import click
import sys
sys.path.append('./')
from examples.instrument import run_example_local
@click.group()
def cli():
pass
@cli.co... | 102 | 0 | 67 |
9687324a6d1d4c0aad3ca95660de57e524efe185 | 510 | py | Python | students/migrations/0004_auto_20210801_0618.py | yamako-tech/yamako-tech-web50-projects-2020-x-capstone | 5ff4faaa2cf1b3489c554232044dfc532213a0a7 | [
"MIT"
] | null | null | null | students/migrations/0004_auto_20210801_0618.py | yamako-tech/yamako-tech-web50-projects-2020-x-capstone | 5ff4faaa2cf1b3489c554232044dfc532213a0a7 | [
"MIT"
] | null | null | null | students/migrations/0004_auto_20210801_0618.py | yamako-tech/yamako-tech-web50-projects-2020-x-capstone | 5ff4faaa2cf1b3489c554232044dfc532213a0a7 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-31 21:18
from django.db import migrations, models
| 22.173913 | 50 | 0.568627 | # Generated by Django 3.2.5 on 2021-07-31 21:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('students', '0003_auto_20210731_2009'),
]
operations = [
migrations.AlterModelOptions(
name='textbook',
options={'ord... | 0 | 396 | 23 |
db3c24c12d152e2453312bcbf65b95284e2451dd | 9,495 | py | Python | tools/living_resources.py | osvenskan/data_rescue_D62CD1E5 | ebcadde2f0046bcfbd3f76166655c56d254e13fc | [
"BSD-3-Clause"
] | null | null | null | tools/living_resources.py | osvenskan/data_rescue_D62CD1E5 | ebcadde2f0046bcfbd3f76166655c56d254e13fc | [
"BSD-3-Clause"
] | null | null | null | tools/living_resources.py | osvenskan/data_rescue_D62CD1E5 | ebcadde2f0046bcfbd3f76166655c56d254e13fc | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Python imports
import collections
# Project imports
import util
import util_date
NAMESPACE = 'LivingResources'
DATE_RANGE = util_date.DATES[NAMESPACE]
"""
LivingResources data has 3 top-level categories (programs) -- Tidal Plankton Data, Tidal Benthic
Data, and Nontidal Benthic Data.
"""
#... | 54.568966 | 144 | 0.627278 | #!/usr/bin/env python
# Python imports
import collections
# Project imports
import util
import util_date
NAMESPACE = 'LivingResources'
DATE_RANGE = util_date.DATES[NAMESPACE]
"""
LivingResources data has 3 top-level categories (programs) -- Tidal Plankton Data, Tidal Benthic
Data, and Nontidal Benthic Data.
"""
#... | 0 | 0 | 0 |
6eabdf90cb21e1477bd6afe8491180df9c31d5b2 | 2,229 | py | Python | server.py | schollz/twittermatic | b66cf1142b77788d485c8f0efed47aa1e41150cf | [
"Unlicense",
"MIT"
] | 8 | 2015-10-09T15:37:33.000Z | 2022-01-03T10:15:21.000Z | server.py | schollz/twittermatic | b66cf1142b77788d485c8f0efed47aa1e41150cf | [
"Unlicense",
"MIT"
] | 9 | 2015-10-09T21:03:03.000Z | 2016-03-12T14:00:20.000Z | server.py | schollz/twittermatic | b66cf1142b77788d485c8f0efed47aa1e41150cf | [
"Unlicense",
"MIT"
] | 3 | 2015-10-08T19:40:49.000Z | 2019-12-17T19:16:37.000Z | import csv
import json
from flask import Flask
from flask import Response
from flask import request
from flask import render_template
from flask.ext.triangle import Triangle
import data.database_commands as database_commands
app = Flask(__name__)
Triangle(app)
@app.route("/")
@app.route("/tweets")
# @app.route("/... | 28.576923 | 71 | 0.612831 | import csv
import json
from flask import Flask
from flask import Response
from flask import request
from flask import render_template
from flask.ext.triangle import Triangle
import data.database_commands as database_commands
app = Flask(__name__)
Triangle(app)
@app.route("/")
def index():
handles = json.load(ope... | 1,174 | 0 | 66 |
40d1a3102a6c8c45938443c8b532d5d246c9d3f2 | 2,347 | py | Python | src/simmate/calculators/vasp/error_handlers/rotation_matrix_nonint.py | laurenmm/simmate-1 | c06b94c46919b01cda50f78221ad14f75c100a14 | [
"BSD-3-Clause"
] | 9 | 2021-12-21T02:58:21.000Z | 2022-01-25T14:00:06.000Z | src/simmate/calculators/vasp/error_handlers/rotation_matrix_nonint.py | laurenmm/simmate-1 | c06b94c46919b01cda50f78221ad14f75c100a14 | [
"BSD-3-Clause"
] | 51 | 2022-01-01T15:59:58.000Z | 2022-03-26T21:25:42.000Z | src/simmate/calculators/vasp/error_handlers/rotation_matrix_nonint.py | laurenmm/simmate-1 | c06b94c46919b01cda50f78221ad14f75c100a14 | [
"BSD-3-Clause"
] | 7 | 2022-01-01T03:44:32.000Z | 2022-03-29T19:59:27.000Z | # -*- coding: utf-8 -*-
import os
import json
from simmate.workflow_engine import ErrorHandler
from simmate.calculators.vasp.inputs import Incar
class RotationNonIntMatrix(ErrorHandler):
"""
This a simple error handler that is active when VASP finds an issue with the
rotation matrix.
"""
is_mon... | 33.528571 | 83 | 0.637836 | # -*- coding: utf-8 -*-
import os
import json
from simmate.workflow_engine import ErrorHandler
from simmate.calculators.vasp.inputs import Incar
class RotationNonIntMatrix(ErrorHandler):
"""
This a simple error handler that is active when VASP finds an issue with the
rotation matrix.
"""
is_mon... | 1,836 | 0 | 27 |
9ed1895ea4a827b4694e3d99b715c2f22204199e | 776 | py | Python | darshan-util/pydarshan/darshan/cli/to_json.py | gaocegege/darshan | 2d54cd8ec96d26db23e9ca421df48d2031a4c55e | [
"mpich2"
] | null | null | null | darshan-util/pydarshan/darshan/cli/to_json.py | gaocegege/darshan | 2d54cd8ec96d26db23e9ca421df48d2031a4c55e | [
"mpich2"
] | null | null | null | darshan-util/pydarshan/darshan/cli/to_json.py | gaocegege/darshan | 2d54cd8ec96d26db23e9ca421df48d2031a4c55e | [
"mpich2"
] | null | null | null | import sys
import argparse
import darshan
if __name__ == "__main__":
main()
| 21.555556 | 95 | 0.668814 | import sys
import argparse
import darshan
def setup_parser(parser=None):
# setup nested actions/subcommands?
#actions = parser.add_subparsers(dest='api')
# setup arguments
parser.add_argument('input', help='darshan log file', nargs='?', default='example.darshan')
parser.add_argument('--verbose'... | 643 | 0 | 46 |
3acc55ec7cebd9acbc300172a3e236a44fad366b | 4,826 | py | Python | crownstone_cloud/cloud.py | crownstone/crownstone-lib-python-cloud | c6a48ab8c6990c5c99d136d9a8cf1df01a7c094d | [
"MIT"
] | 1 | 2020-05-29T23:45:15.000Z | 2020-05-29T23:45:15.000Z | crownstone_cloud/cloud.py | crownstone/crownstone-lib-python-cloud | c6a48ab8c6990c5c99d136d9a8cf1df01a7c094d | [
"MIT"
] | 3 | 2021-11-09T15:36:48.000Z | 2021-11-12T00:43:23.000Z | crownstone_cloud/cloud.py | crownstone/crownstone-lib-python-cloud | c6a48ab8c6990c5c99d136d9a8cf1df01a7c094d | [
"MIT"
] | 1 | 2021-11-09T15:33:01.000Z | 2021-11-09T15:33:01.000Z | """Main class for the Crownstone cloud cloud."""
from __future__ import annotations
import asyncio
import logging
import aiohttp
from crownstone_cloud.cloud_models.crownstones import Crownstone
from crownstone_cloud.cloud_models.spheres import Spheres
from crownstone_cloud.exceptions import CrownstoneNotFoundError
f... | 33.513889 | 82 | 0.640075 | """Main class for the Crownstone cloud cloud."""
from __future__ import annotations
import asyncio
import logging
import aiohttp
from crownstone_cloud.cloud_models.crownstones import Crownstone
from crownstone_cloud.cloud_models.spheres import Spheres
from crownstone_cloud.exceptions import CrownstoneNotFoundError
f... | 274 | 0 | 27 |
3f157bc25feb7dd79f2e1fa5015bd441d9c0eef3 | 8,773 | py | Python | corehq/apps/locations/util.py | bglar/commcare-hq | 972129fc26864c08c7bef07874bd2a7218550bff | [
"BSD-3-Clause"
] | 1 | 2017-02-10T03:14:51.000Z | 2017-02-10T03:14:51.000Z | corehq/apps/locations/util.py | bglar/commcare-hq | 972129fc26864c08c7bef07874bd2a7218550bff | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/locations/util.py | bglar/commcare-hq | 972129fc26864c08c7bef07874bd2a7218550bff | [
"BSD-3-Clause"
] | null | null | null | from corehq.apps.commtrack.models import SupplyPointCase
from corehq.apps.products.models import Product
from corehq.apps.locations.models import Location, SQLLocation
from corehq.apps.domain.models import Domain
from corehq.util.quickcache import quickcache
from dimagi.utils.decorators.memoized import memoized
from di... | 34.952191 | 115 | 0.640032 | from corehq.apps.commtrack.models import SupplyPointCase
from corehq.apps.products.models import Product
from corehq.apps.locations.models import Location, SQLLocation
from corehq.apps.domain.models import Domain
from corehq.util.quickcache import quickcache
from dimagi.utils.decorators.memoized import memoized
from di... | 5,236 | 227 | 186 |
b784ed5536e878aab0baf0382c465a053b11a1b1 | 6,704 | py | Python | google/cloud/forseti/enforcer/enforcer.py | mitsuo0114/forseti-security | a21dc6b7a7420a60f02c1a4bdfbab9e101291dd2 | [
"Apache-2.0"
] | 1 | 2018-10-06T23:16:59.000Z | 2018-10-06T23:16:59.000Z | google/cloud/forseti/enforcer/enforcer.py | mitsuo0114/forseti-security | a21dc6b7a7420a60f02c1a4bdfbab9e101291dd2 | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/enforcer/enforcer.py | mitsuo0114/forseti-security | a21dc6b7a7420a60f02c1a4bdfbab9e101291dd2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 34.379487 | 80 | 0.676909 | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 0 | 0 | 0 |
cebe158fa96d11636d7e608ec07e33216f13dd64 | 368 | py | Python | admin_tools/urls.py | asherf/django-admin-tools | 26a993545de7d68286be56ac640fe12acf1a1abe | [
"MIT"
] | 1 | 2020-04-06T23:21:17.000Z | 2020-04-06T23:21:17.000Z | admin_tools/urls.py | asherf/django-admin-tools | 26a993545de7d68286be56ac640fe12acf1a1abe | [
"MIT"
] | 6 | 2020-03-25T16:58:30.000Z | 2021-06-10T19:55:55.000Z | admin_tools/urls.py | asherf/django-admin-tools | 26a993545de7d68286be56ac640fe12acf1a1abe | [
"MIT"
] | 1 | 2020-02-24T22:34:17.000Z | 2020-02-24T22:34:17.000Z | from django.conf import settings
from django.conf.urls import url, include
urlpatterns = []
if 'admin_tools.menu' in settings.INSTALLED_APPS:
urlpatterns.append(url(r'^menu/', include('admin_tools.menu.urls')))
if 'admin_tools.dashboard' in settings.INSTALLED_APPS:
urlpatterns.append(
url(r'^dashboard/... | 33.454545 | 72 | 0.73913 | from django.conf import settings
from django.conf.urls import url, include
urlpatterns = []
if 'admin_tools.menu' in settings.INSTALLED_APPS:
urlpatterns.append(url(r'^menu/', include('admin_tools.menu.urls')))
if 'admin_tools.dashboard' in settings.INSTALLED_APPS:
urlpatterns.append(
url(r'^dashboard/... | 0 | 0 | 0 |
5a22efca0450afe45817960d54602b633e1343fa | 622 | py | Python | app/models/__init__.py | dandye/DjanGoat | 72beb30afe3ddd5b31ce74a5d3b9da61d2c5df1d | [
"MIT"
] | 65 | 2017-08-18T15:12:03.000Z | 2021-08-14T16:50:07.000Z | app/models/__init__.py | dandye/DjanGoat | 72beb30afe3ddd5b31ce74a5d3b9da61d2c5df1d | [
"MIT"
] | 83 | 2017-11-28T21:45:20.000Z | 2021-11-02T18:52:52.000Z | app/models/__init__.py | dandye/DjanGoat | 72beb30afe3ddd5b31ce74a5d3b9da61d2c5df1d | [
"MIT"
] | 71 | 2017-08-17T14:58:01.000Z | 2022-02-02T17:09:49.000Z | from app.models.Note.note import Note
from app.models.Message.message import Message
from app.models.User.user import User
from app.models.Analytics.analytics import Analytics
from app.models.Benefits.benefits import Benefits
from app.models.KeyManagement.key_management import KeyManagement
from app.models.PaidTimeOff.... | 47.846154 | 65 | 0.861736 | from app.models.Note.note import Note
from app.models.Message.message import Message
from app.models.User.user import User
from app.models.Analytics.analytics import Analytics
from app.models.Benefits.benefits import Benefits
from app.models.KeyManagement.key_management import KeyManagement
from app.models.PaidTimeOff.... | 0 | 0 | 0 |
95b23018af8b6d6db6b5511ee2ad613d8f7f0859 | 32,798 | py | Python | resources/libraries/python/DUTSetup.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/DUTSetup.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | resources/libraries/python/DUTSetup.py | preym17/csit | 3151c98618c78e3782e48bbe4d9c8f906c126f69 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 38.048724 | 80 | 0.566071 | # Copyright (c) 2018 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 0 | 0 | 0 |
ce31817538eccc99f0a4ef09f78d47d2ed58961a | 313 | py | Python | tests/test_card.py | joumaico/coreutil | 9388e7426df96175f9a30d841b4c280179f37633 | [
"MIT"
] | null | null | null | tests/test_card.py | joumaico/coreutil | 9388e7426df96175f9a30d841b4c280179f37633 | [
"MIT"
] | null | null | null | tests/test_card.py | joumaico/coreutil | 9388e7426df96175f9a30d841b4c280179f37633 | [
"MIT"
] | null | null | null | import coreutil
import unittest
| 28.454545 | 66 | 0.696486 | import coreutil
import unittest
class TestCard(unittest.TestCase):
def test_credit(self):
card = coreutil.card.credit('378282246310005')
self.assertTrue(card.isvalid())
self.assertEqual(card.network().short, 'amex')
self.assertEqual(card.network().brand, 'American Express')
| 218 | 13 | 49 |
21e754d69abc89769daf7e31f441ea29a015848c | 171 | py | Python | book_crawler/run.py | zheng-zy/book_crawler | a092607a097986e9cd242809066e0948e64d8bcb | [
"Apache-2.0"
] | null | null | null | book_crawler/run.py | zheng-zy/book_crawler | a092607a097986e9cd242809066e0948e64d8bcb | [
"Apache-2.0"
] | null | null | null | book_crawler/run.py | zheng-zy/book_crawler | a092607a097986e9cd242809066e0948e64d8bcb | [
"Apache-2.0"
] | null | null | null | #!usr/bin/env python
# coding=utf-8
# Created by zhezhiyong@163.com on 2016/11/16.
"""
启动
"""
from scrapy import cmdline
cmdline.execute("scrapy crawl biquge".split())
| 14.25 | 46 | 0.707602 | #!usr/bin/env python
# coding=utf-8
# Created by zhezhiyong@163.com on 2016/11/16.
"""
启动
"""
from scrapy import cmdline
cmdline.execute("scrapy crawl biquge".split())
| 0 | 0 | 0 |
54e66a5e54bee3047e85fcfaef77f2b1ac20bf82 | 302 | py | Python | pykage/setup.py | antoineB24/pykage | 472bd9b80f93b3a1c61851370915b843ff2719c9 | [
"MIT"
] | null | null | null | pykage/setup.py | antoineB24/pykage | 472bd9b80f93b3a1c61851370915b843ff2719c9 | [
"MIT"
] | null | null | null | pykage/setup.py | antoineB24/pykage | 472bd9b80f93b3a1c61851370915b843ff2719c9 | [
"MIT"
] | null | null | null | from cx_Freeze import setup, Executable
files = {"include_files": [
"command/",
], "packages": []}
setup(
name="pykage",
version="0.1.5",
description="npmjs en python",
options={'build_exe': files},
executables=[Executable("pykage.py", base=None)])
| 23.230769 | 50 | 0.576159 | from cx_Freeze import setup, Executable
files = {"include_files": [
"command/",
], "packages": []}
setup(
name="pykage",
version="0.1.5",
description="npmjs en python",
options={'build_exe': files},
executables=[Executable("pykage.py", base=None)])
| 0 | 0 | 0 |
f59eeebd98b7f8a8cf9843ade228600b961393ee | 1,454 | py | Python | src/onegov/core/security/roles.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/roles.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/core/security/roles.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from onegov.core.framework import Framework
from onegov.core.security import Public, Personal, Private, Secret
@Framework.setting_section(section="roles")
def get_roles_setting():
""" Returns the default roles available to onegov.core applications.
Applications building on onegov.core may add more roles and ... | 26.436364 | 77 | 0.591472 | from onegov.core.framework import Framework
from onegov.core.security import Public, Personal, Private, Secret
@Framework.setting_section(section="roles")
def get_roles_setting():
""" Returns the default roles available to onegov.core applications.
Applications building on onegov.core may add more roles and ... | 0 | 0 | 0 |
84900ee8ef51e507d9d9ff1b73f2ced60e75a3c0 | 732 | py | Python | pkgcore/test/cache/test_flat_hash.py | pombreda/pkgcore | b438fc573af1a031d7ce12adbbf299bab5338451 | [
"BSD-3-Clause"
] | 1 | 2021-07-05T13:10:18.000Z | 2021-07-05T13:10:18.000Z | pkgcore/test/cache/test_flat_hash.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | 8 | 2015-03-24T14:21:44.000Z | 2015-03-24T14:21:44.000Z | pkgcore/test/cache/test_flat_hash.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | null | null | null | # Copyright: 2006 Brian Harring <ferringb@gmail.com>
# License: GPL2/BSD
from snakeoil.test.mixins import TempDirMixin
from pkgcore.cache import flat_hash
from pkgcore.test.cache import util, test_base
| 27.111111 | 71 | 0.703552 | # Copyright: 2006 Brian Harring <ferringb@gmail.com>
# License: GPL2/BSD
from snakeoil.test.mixins import TempDirMixin
from pkgcore.cache import flat_hash
from pkgcore.test.cache import util, test_base
class db(flat_hash.database):
def __setitem__(self, cpv, data):
data['_chf_'] = test_base._chf_obj
... | 355 | 44 | 127 |
3de6852662f7918708904ec09050295efde9728e | 3,616 | py | Python | rqalpha/utils/functools.py | tranzwalle/rqalphax | 5a85d5c8c9df988ace26b68852c9ec39ad2de6df | [
"Apache-2.0"
] | 1 | 2022-01-27T15:37:31.000Z | 2022-01-27T15:37:31.000Z | rqalpha/utils/functools.py | tranzwalle/rqalphax | 5a85d5c8c9df988ace26b68852c9ec39ad2de6df | [
"Apache-2.0"
] | 1 | 2021-12-21T08:14:51.000Z | 2021-12-21T08:14:51.000Z | rqalpha/utils/functools.py | tranzwalle/rqalphax | 5a85d5c8c9df988ace26b68852c9ec39ad2de6df | [
"Apache-2.0"
] | 1 | 2022-03-30T11:50:20.000Z | 2022-03-30T11:50:20.000Z | # -*- coding: utf-8 -*-
# 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”)
#
# 除非遵守当前许可,否则不得使用本软件。
#
# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件):
# 遵守 Apache License 2.0(下称“Apache 2.0 许可”),
# 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。
# 除非法律有要求或以书面形式达成协议,否则本软件分发时... | 32.576577 | 104 | 0.625 | # -*- coding: utf-8 -*-
# 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”)
#
# 除非遵守当前许可,否则不得使用本软件。
#
# * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件):
# 遵守 Apache License 2.0(下称“Apache 2.0 许可”),
# 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。
# 除非法律有要求或以书面形式达成协议,否则本软件分发时... | 2,694 | 0 | 69 |
f09f90174f6ec9d109747da36951eb742860b8c9 | 14,593 | py | Python | bomeba0/templates/glycans.py | aloctavodia/bomeba0 | e212986d8ee60be1da91d63a7a889db14ec851c3 | [
"Apache-2.0"
] | null | null | null | bomeba0/templates/glycans.py | aloctavodia/bomeba0 | e212986d8ee60be1da91d63a7a889db14ec851c3 | [
"Apache-2.0"
] | 28 | 2017-06-01T15:46:33.000Z | 2021-07-01T18:28:36.000Z | bomeba0/templates/glycans.py | aloctavodia/bomeba0 | e212986d8ee60be1da91d63a7a889db14ec851c3 | [
"Apache-2.0"
] | 6 | 2017-09-30T13:26:08.000Z | 2022-02-13T10:01:18.000Z | from collections import namedtuple
import numpy as np
"""
Templates for glycan residues
"""
AA_info = namedtuple('AA_info', 'coords atom_names bonds bb sc offset')
BDP_info = AA_info(coords=np.array([[-14.69, 10.15, -18.15],
[-15.46, 11.47, -18.33],
... | 47.37987 | 329 | 0.299459 | from collections import namedtuple
import numpy as np
"""
Templates for glycan residues
"""
AA_info = namedtuple('AA_info', 'coords atom_names bonds bb sc offset')
BDP_info = AA_info(coords=np.array([[-14.69, 10.15, -18.15],
[-15.46, 11.47, -18.33],
... | 0 | 0 | 0 |
093a1b57300718525312eed9124b9ef5739f331a | 2,761 | py | Python | model.py | haizeigh/TransformerTest | 7e0f6b6590c90ac45d749077c4b329bb6b2dacca | [
"MIT"
] | 39 | 2020-05-02T14:45:00.000Z | 2022-03-30T08:32:19.000Z | model.py | haizeigh/TransformerTest | 7e0f6b6590c90ac45d749077c4b329bb6b2dacca | [
"MIT"
] | null | null | null | model.py | haizeigh/TransformerTest | 7e0f6b6590c90ac45d749077c4b329bb6b2dacca | [
"MIT"
] | 11 | 2020-05-17T06:51:38.000Z | 2022-01-23T04:17:43.000Z | import torch
from torch import nn
import math
| 37.821918 | 110 | 0.623687 | import torch
from torch import nn
import math
class PositionalEncoding(nn.Module):
def __init__(self, d_model, dropout=0.1, max_len=100):
super(PositionalEncoding, self).__init__()
self.dropout = nn.Dropout(p=dropout)
pe = torch.zeros(max_len, d_model)
position = torch.arange(0, m... | 2,480 | 28 | 206 |
5fbca564b6fc867c711e32a5b0b9d483f86650a4 | 694 | py | Python | src/coalescenceml/metadata_store/__init__.py | CornellDataScience/CoalescenceML | 6dd849b272c77011719952b47d5b55684d90733a | [
"Apache-2.0"
] | 1 | 2022-03-22T17:48:55.000Z | 2022-03-22T17:48:55.000Z | src/coalescenceml/metadata_store/__init__.py | CornellDataScience/CoalescenceML | 6dd849b272c77011719952b47d5b55684d90733a | [
"Apache-2.0"
] | 2 | 2022-02-18T18:48:12.000Z | 2022-02-19T18:14:38.000Z | src/coalescenceml/metadata_store/__init__.py | CornellDataScience/CoalescenceML | 6dd849b272c77011719952b47d5b55684d90733a | [
"Apache-2.0"
] | 1 | 2022-02-10T02:52:22.000Z | 2022-02-10T02:52:22.000Z | """
## Metadata Store
The configuration of each pipeline, step, backend, and produced artifacts are
all tracked within the metadata store. The metadata store is an SQL database,
and can be `sqlite` or `mysql`.
Metadata are the pieces of information tracked about the pipelines, experiments
and configurations that you a... | 30.173913 | 80 | 0.802594 | """
## Metadata Store
The configuration of each pipeline, step, backend, and produced artifacts are
all tracked within the metadata store. The metadata store is an SQL database,
and can be `sqlite` or `mysql`.
Metadata are the pieces of information tracked about the pipelines, experiments
and configurations that you a... | 0 | 0 | 0 |
6da9028e02ef5241c0c4f065efb85de39f513eba | 2,497 | py | Python | features/tests/test_service.py | wkevina/feature-requests-app | 6580f5eced4a4f3322da1ce3ab2803e0c57938ac | [
"MIT"
] | null | null | null | features/tests/test_service.py | wkevina/feature-requests-app | 6580f5eced4a4f3322da1ce3ab2803e0c57938ac | [
"MIT"
] | null | null | null | features/tests/test_service.py | wkevina/feature-requests-app | 6580f5eced4a4f3322da1ce3ab2803e0c57938ac | [
"MIT"
] | null | null | null | from django.test import TestCase
from ..service import shift_client_priority
from ..models import Client, ProductArea, FeatureRequest
class TestShiftClientPriority(TestCase):
"""Test service.shift_client_priority"""
def test_basic(self):
"""Should shift all priorities up by one"""
# Add 10 ... | 32.428571 | 74 | 0.629555 | from django.test import TestCase
from ..service import shift_client_priority
from ..models import Client, ProductArea, FeatureRequest
def add_feature(client, product_area, **kwargs):
args = dict(client=client,
product_area=product_area,
target_date='2016-1-1')
args.update(kwa... | 395 | 0 | 50 |
92db293498fd8f1ab38064f3db1404cc4729b205 | 4,861 | py | Python | PublicWebServicesAPI_AND_servercommandScripts/simpleTopUpBalance/simpleTopUpBalance.py | PaperCutSoftware/PaperCutExamples | 392f284939bb498d621600c68a997a8d3559bc77 | [
"MIT"
] | 59 | 2015-10-02T18:42:19.000Z | 2022-01-01T09:37:26.000Z | PublicWebServicesAPI_AND_servercommandScripts/simpleTopUpBalance/simpleTopUpBalance.py | PaperCutSoftware/PaperCutExamples | 392f284939bb498d621600c68a997a8d3559bc77 | [
"MIT"
] | 16 | 2016-06-16T06:42:49.000Z | 2021-08-31T22:49:59.000Z | PublicWebServicesAPI_AND_servercommandScripts/simpleTopUpBalance/simpleTopUpBalance.py | PaperCutSoftware/PaperCutExamples | 392f284939bb498d621600c68a997a8d3559bc77 | [
"MIT"
] | 20 | 2015-09-09T16:27:33.000Z | 2020-11-12T18:17:36.000Z | #!/usr/bin/env python
# Small web app to allow a user to top up their personal PaperCut balance
# Add a custom URL to the PaperCut user web page, which is used by end users
# when they want to add credit to their PaperCut personal account. The url
# should refer to this small web app When the user clicks on the URL l... | 38.275591 | 154 | 0.727628 | #!/usr/bin/env python
# Small web app to allow a user to top up their personal PaperCut balance
# Add a custom URL to the PaperCut user web page, which is used by end users
# when they want to add credit to their PaperCut personal account. The url
# should refer to this small web app When the user clicks on the URL l... | 2,174 | 0 | 88 |
371d8878b031f08785e6952cc7b14ad180d14add | 2,226 | py | Python | generate.py | jseguillon/get-awx | 8c3c4be2f53d9bc1e1d1556117190c7619134acc | [
"MIT"
] | null | null | null | generate.py | jseguillon/get-awx | 8c3c4be2f53d9bc1e1d1556117190c7619134acc | [
"MIT"
] | null | null | null | generate.py | jseguillon/get-awx | 8c3c4be2f53d9bc1e1d1556117190c7619134acc | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os, yaml, json, shlex, datetime
import logging
logging.basicConfig(level=logging.INFO)
from jinja2 import Environment, FileSystemLoader
from datetime import datetime
from shutil import copyfile
# Mimic Ansible addional Jinja filter
# Prepare Jinja envs
env = Environment(loader = FileSys... | 28.909091 | 90 | 0.743935 | #!/usr/bin/env python
import os, yaml, json, shlex, datetime
import logging
logging.basicConfig(level=logging.INFO)
from jinja2 import Environment, FileSystemLoader
from datetime import datetime
from shutil import copyfile
# Mimic Ansible addional Jinja filter
def quote(input):
logging.debug("Quoting : %s", inpu... | 72 | 0 | 22 |
4120a6254f740d446bdedbcf16a3b5f9b9dc4b49 | 6,777 | py | Python | scrape_weather.py | rbbastos/Weather_Processing_App | c77b61e95e53851634afa3a0b1500a1227dcb443 | [
"MIT"
] | null | null | null | scrape_weather.py | rbbastos/Weather_Processing_App | c77b61e95e53851634afa3a0b1500a1227dcb443 | [
"MIT"
] | null | null | null | scrape_weather.py | rbbastos/Weather_Processing_App | c77b61e95e53851634afa3a0b1500a1227dcb443 | [
"MIT"
] | null | null | null | """Module: Creates a WeatherScraper class to scrape data from website."""
import urllib.request
import datetime
import time
from time import strptime
from html.parser import HTMLParser
from html.entities import name2codepoint
class WeatherScraper(HTMLParser):
"""This class contains HTMLParser functions."""
d... | 33.549505 | 78 | 0.449461 | """Module: Creates a WeatherScraper class to scrape data from website."""
import urllib.request
import datetime
import time
from time import strptime
from html.parser import HTMLParser
from html.entities import name2codepoint
class WeatherScraper(HTMLParser):
"""This class contains HTMLParser functions."""
d... | 0 | 0 | 0 |
6e85a1b14c54d8fac368ba969c95b6dc1c2eb330 | 1,020 | py | Python | drone_control/record_video.py | maxhchen/eecs149-final-project | 4b3fd66c59d2f60f85006c8781fbb5eb0e50723a | [
"MIT"
] | 1 | 2022-01-15T20:26:47.000Z | 2022-01-15T20:26:47.000Z | drone_control/record_video.py | maxhchen/eecs149-final-project | 4b3fd66c59d2f60f85006c8781fbb5eb0e50723a | [
"MIT"
] | null | null | null | drone_control/record_video.py | maxhchen/eecs149-final-project | 4b3fd66c59d2f60f85006c8781fbb5eb0e50723a | [
"MIT"
] | null | null | null | import time, cv2
from threading import Thread
from djitellopy import Tello
FPS = 30
tello = Tello()
tello.connect()
print("Battery level:", tello.get_battery())
keepRecording = True
tello.streamon()
frame_read = tello.get_frame_read()
# we need to run the recorder in a seperate thread, otherwise blocking options
# ... | 23.181818 | 95 | 0.709804 | import time, cv2
from threading import Thread
from djitellopy import Tello
FPS = 30
tello = Tello()
tello.connect()
print("Battery level:", tello.get_battery())
keepRecording = True
tello.streamon()
frame_read = tello.get_frame_read()
def video_recorder():
height, width, _ = frame_read.frame.shape
video = c... | 307 | 0 | 23 |
a47d322a9a5e9bda464a37de739f116470546692 | 1,901 | py | Python | bireme/biblioref/migrations/0004_auto_20150902_1229.py | rfdeoliveira/fi-admin | c2df084c7e79d587e2273dc222f106fa243b7f6e | [
"MIT",
"Python-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | bireme/biblioref/migrations/0004_auto_20150902_1229.py | rfdeoliveira/fi-admin | c2df084c7e79d587e2273dc222f106fa243b7f6e | [
"MIT",
"Python-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | bireme/biblioref/migrations/0004_auto_20150902_1229.py | rfdeoliveira/fi-admin | c2df084c7e79d587e2273dc222f106fa243b7f6e | [
"MIT",
"Python-2.0",
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import utils.fields
| 43.204545 | 137 | 0.622304 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import utils.fields
class Migration(migrations.Migration):
dependencies = [
('biblioref', '0003_auto_20150901_1025'),
]
operations = [
migrations.CreateModel(
name='Refer... | 0 | 1,751 | 23 |
05b01b55fd1d0c2d100e825d487acf27fb75a047 | 748 | py | Python | tests/variable/test_use_local_in_initializer.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | 2 | 2021-12-18T01:52:50.000Z | 2022-01-17T19:41:52.000Z | tests/variable/test_use_local_in_initializer.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | 18 | 2021-11-30T04:05:53.000Z | 2022-02-01T03:30:04.000Z | tests/variable/test_use_local_in_initializer.py | sco1/pylox | b4820828306c20cee3f8533c2547fafb92c6c1bd | [
"MIT"
] | null | null | null | from textwrap import dedent
import pytest
from pylox.lox import Lox
# Base cases from https://github.com/munificent/craftinginterpreters/blob/master/test/variable/use_local_in_initializer.lox
TEST_SRC = dedent(
"""\
var a = "outer";
{
var a = a; // Error at 'a': Can't read local variable in its own... | 25.793103 | 123 | 0.721925 | from textwrap import dedent
import pytest
from pylox.lox import Lox
# Base cases from https://github.com/munificent/craftinginterpreters/blob/master/test/variable/use_local_in_initializer.lox
TEST_SRC = dedent(
"""\
var a = "outer";
{
var a = a; // Error at 'a': Can't read local variable in its own... | 276 | 0 | 23 |
b43a716afff8ac59493a9d2793b6c660350d23ad | 13,453 | py | Python | lfs/lfs_eeg.py | shiningsunnyday/chestXRay | 75712a34cf025df60261f195262cc671a9fa04dc | [
"Apache-2.0"
] | 9 | 2019-05-27T21:33:13.000Z | 2022-02-24T02:30:16.000Z | lfs/lfs_eeg.py | shiningsunnyday/chestXRay | 75712a34cf025df60261f195262cc671a9fa04dc | [
"Apache-2.0"
] | null | null | null | lfs/lfs_eeg.py | shiningsunnyday/chestXRay | 75712a34cf025df60261f195262cc671a9fa04dc | [
"Apache-2.0"
] | 5 | 2019-06-01T00:36:25.000Z | 2021-11-15T17:09:14.000Z | import re
import spacy
spacy_en = spacy.load('en_core_web_sm')
# Setting LF output values
ABSTAIN_VAL = 0
SEIZURE_VAL = 1
NO_SEIZURE_VAL = -1
######################################################################################################
##### HELPFUL REGEXES AND ONTOLOGIES
####################################... | 37.895775 | 124 | 0.592953 | import re
import spacy
spacy_en = spacy.load('en_core_web_sm')
# Setting LF output values
ABSTAIN_VAL = 0
SEIZURE_VAL = 1
NO_SEIZURE_VAL = -1
######################################################################################################
##### HELPFUL REGEXES AND ONTOLOGIES
####################################... | 0 | 0 | 0 |
69dbba474be55d7f5d144dd4498854100f8c4b6b | 313 | py | Python | find_missing.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | find_missing.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | find_missing.py | Kunalpod/codewars | 8dc1af2f3c70e209471045118fd88b3ea1e627e5 | [
"MIT"
] | null | null | null | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Find the missing term in an Arithmetic Progression
#Problem level: 5 kyu
| 31.3 | 94 | 0.58147 | #Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Find the missing term in an Arithmetic Progression
#Problem level: 5 kyu
def find_missing(s):
for i in range(1, len(s)-1):
if s[i]-s[i-1] != s[i+1]-s[i]:
return 2*s[i]-s[i-1] if abs(s[i] - s[i-1]) < abs(s[i+1] - s[i]) else 2*s[i]-s[i+1]
| 166 | 0 | 23 |
466de17ce18f9b0f37cc8bbacbd2c4cb46780504 | 1,698 | py | Python | tests/dataverk/test_datapackage.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 3 | 2019-09-29T20:48:46.000Z | 2021-03-31T10:16:07.000Z | tests/dataverk/test_datapackage.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 148 | 2019-02-08T12:30:58.000Z | 2021-03-11T15:31:55.000Z | tests/dataverk/test_datapackage.py | navikt/dataverk | 7dd803236433048686dd7a58358bc1c09565b14b | [
"MIT"
] | 1 | 2020-11-18T14:10:05.000Z | 2020-11-18T14:10:05.000Z | import os
import unittest
from dataverk.datapackage import Datapackage
from dataverk.exceptions.dataverk_exceptions import EnvironmentVariableNotSet
from dataverk.utils import storage_paths
valid_metadata = {
'title': 'title',
'readme': "readme",
'license': 'MIT',
'accessRights': 'Open',
'auth': 'u... | 28.3 | 77 | 0.657244 | import os
import unittest
from dataverk.datapackage import Datapackage
from dataverk.exceptions.dataverk_exceptions import EnvironmentVariableNotSet
from dataverk.utils import storage_paths
valid_metadata = {
'title': 'title',
'readme': "readme",
'license': 'MIT',
'accessRights': 'Open',
'auth': 'u... | 844 | 54 | 181 |
33f2919884e5b7e7f21877ccbd78c73ebaf908bc | 3,966 | py | Python | shoppingapp/views.py | KONAPAVANKUMAR/shopping-app-django | f0494a47e4b953cc63198c66f50bc59b94ddc860 | [
"MIT"
] | null | null | null | shoppingapp/views.py | KONAPAVANKUMAR/shopping-app-django | f0494a47e4b953cc63198c66f50bc59b94ddc860 | [
"MIT"
] | null | null | null | shoppingapp/views.py | KONAPAVANKUMAR/shopping-app-django | f0494a47e4b953cc63198c66f50bc59b94ddc860 | [
"MIT"
] | null | null | null | from django.shortcuts import render,redirect
from .models import *
from django.contrib import messages
from django.contrib.auth import login,logout,authenticate
# Create your views here.
from datetime import date
| 37.065421 | 114 | 0.703227 | from django.shortcuts import render,redirect
from .models import *
from django.contrib import messages
from django.contrib.auth import login,logout,authenticate
# Create your views here.
def logoutuser(request):
logout(request)
return redirect('homepage')
def loginview(request):
return render(request,"sho... | 3,433 | 0 | 319 |
ed3fbe249d1378ec4305fb66ee15835b31c365fc | 9,439 | py | Python | src/inscriptis/model/table.py | rlskoeser/inscriptis | e23f79a4ad561f53943c3c6dd70a7d4981b0e0fb | [
"Apache-2.0"
] | 90 | 2016-01-29T15:09:21.000Z | 2022-03-08T15:08:57.000Z | src/inscriptis/model/table.py | rlskoeser/inscriptis | e23f79a4ad561f53943c3c6dd70a7d4981b0e0fb | [
"Apache-2.0"
] | 27 | 2016-01-14T10:30:10.000Z | 2022-03-24T08:00:31.000Z | src/inscriptis/model/table.py | rlskoeser/inscriptis | e23f79a4ad561f53943c3c6dd70a7d4981b0e0fb | [
"Apache-2.0"
] | 20 | 2016-01-14T12:50:55.000Z | 2022-03-04T07:26:30.000Z | #!/usr/bin/env python3
# encoding: utf-8
"""Classes used for representing Tables, TableRows and TableCells."""
from typing import List
from itertools import chain, accumulate
from inscriptis.html_properties import HorizontalAlignment, VerticalAlignment
from inscriptis.annotation import Annotation, horizontal_shift
fr... | 35.220149 | 79 | 0.569658 | #!/usr/bin/env python3
# encoding: utf-8
"""Classes used for representing Tables, TableRows and TableCells."""
from typing import List
from itertools import chain, accumulate
from inscriptis.html_properties import HorizontalAlignment, VerticalAlignment
from inscriptis.annotation import Annotation, horizontal_shift
fr... | 462 | 0 | 108 |
52855729e5cdbb244154d3e3f059f2436b795ff9 | 261 | py | Python | flask_api/__init__.py | kingofsandvich/Program-for-Stylizing-Musical-Compositions-Based-on-Machine-Learning | bd730427a82bdc379177c5f7d33274ed8c9afe72 | [
"MIT"
] | null | null | null | flask_api/__init__.py | kingofsandvich/Program-for-Stylizing-Musical-Compositions-Based-on-Machine-Learning | bd730427a82bdc379177c5f7d33274ed8c9afe72 | [
"MIT"
] | null | null | null | flask_api/__init__.py | kingofsandvich/Program-for-Stylizing-Musical-Compositions-Based-on-Machine-Learning | bd730427a82bdc379177c5f7d33274ed8c9afe72 | [
"MIT"
] | null | null | null | from config import Config
from flask import Flask
| 17.4 | 61 | 0.735632 | from config import Config
from flask import Flask
def create_app(config=Config):
app = Flask(__name__)
app.config.from_object(config)
from . models_api import models
app.register_blueprint(models, url_prefix='/style_model')
return app
| 186 | 0 | 23 |
a03f6959328a0b40991c5eae5c7f38e786add882 | 2,238 | py | Python | step_by_step_code_blocks/split_train_validate.py | AlphaVantageSupport/time-series-forecasting-pytorch | 9d68a0d7ded73592e0a21c08d7652ee8188760bb | [
"Apache-2.0"
] | 43 | 2021-04-29T18:36:48.000Z | 2022-03-23T04:20:42.000Z | step_by_step_code_blocks/split_train_validate.py | djshem/time-series-forecasting-pytorch | defc88f5995c4356c337c14212b684abc7ca1cb7 | [
"Apache-2.0"
] | 9 | 2021-05-21T14:13:07.000Z | 2022-03-17T11:04:49.000Z | step_by_step_code_blocks/split_train_validate.py | djshem/time-series-forecasting-pytorch | defc88f5995c4356c337c14212b684abc7ca1cb7 | [
"Apache-2.0"
] | 26 | 2021-04-29T22:34:30.000Z | 2022-03-31T09:31:13.000Z |
data_x, data_x_unseen = prepare_data_x(normalized_data_close_price, window_size=config["data"]["window_size"])
data_y = prepare_data_y(normalized_data_close_price, window_size=config["data"]["window_size"])
# split dataset
split_index = int(data_y.shape[0]*config["data"]["train_split_size"])
data_x_train = data_x[:... | 43.882353 | 217 | 0.743968 | def prepare_data_x(x, window_size):
# perform windowing
n_row = x.shape[0] - window_size + 1
output = np.lib.stride_tricks.as_strided(x, shape=(n_row, window_size), strides=(x.strides[0], x.strides[0]))
return output[:-1], output[-1]
def prepare_data_y(x, window_size):
# # perform simple moving av... | 435 | 0 | 45 |
f5c2ac374420189e47c9161aa9686ce368683db5 | 5,367 | py | Python | magfetch/settings/common.py | NumanIbnMazid/magfetch | fb6297fd3b2277bf48289ff95d1ed4f071b9aded | [
"MIT"
] | 1 | 2020-03-13T07:09:34.000Z | 2020-03-13T07:09:34.000Z | magfetch/settings/common.py | NumanIbnMazid/magfetch | fb6297fd3b2277bf48289ff95d1ed4f071b9aded | [
"MIT"
] | 8 | 2020-02-11T23:52:58.000Z | 2022-03-11T23:42:09.000Z | magfetch/settings/common.py | NumanIbnMazid/magfetch | fb6297fd3b2277bf48289ff95d1ed4f071b9aded | [
"MIT"
] | 1 | 2020-03-13T07:09:35.000Z | 2020-03-13T07:09:35.000Z |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Third Party Apps
'wid... | 26.969849 | 91 | 0.662754 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Third Party Apps
'wid... | 0 | 0 | 0 |
1f500aed9bfce93cd45309a81d07439da902bcae | 4,513 | py | Python | main.py | NortySpock/TESS | 639c7c157bf17b8eb0527ec135dd1fefa4e2038c | [
"MIT"
] | null | null | null | main.py | NortySpock/TESS | 639c7c157bf17b8eb0527ec135dd1fefa4e2038c | [
"MIT"
] | null | null | null | main.py | NortySpock/TESS | 639c7c157bf17b8eb0527ec135dd1fefa4e2038c | [
"MIT"
] | null | null | null | # TESS - ToastmastErs Simple Scheduler
# This simple script will create a shuffled list of suggested meeting roles for multiple meetings.
from random import shuffle
from os import linesep
import csv
import sys
if __name__ == "__main__":
main(sys.argv[1:]) | 33.932331 | 130 | 0.669621 | # TESS - ToastmastErs Simple Scheduler
# This simple script will create a shuffled list of suggested meeting roles for multiple meetings.
from random import shuffle
from os import linesep
import csv
import sys
def main(argv):
if(len(sys.argv) == 2):
try:
number_of_meetings = int(sys.argv[1])
excep... | 4,229 | 0 | 23 |
e26da87d1a7e5fed466d77acba027ac3c6b8e4a9 | 2,671 | py | Python | src/core/src/tortuga/os_utility/tortugaSubprocess.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 33 | 2018-03-02T17:07:39.000Z | 2021-05-21T18:02:51.000Z | src/core/src/tortuga/os_utility/tortugaSubprocess.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 201 | 2018-03-05T14:28:24.000Z | 2020-11-23T19:58:27.000Z | src/core/src/tortuga/os_utility/tortugaSubprocess.py | sutasu/tortuga | 48d7cde4fa652346600b217043b4a734fa2ba455 | [
"Apache-2.0"
] | 23 | 2018-03-02T17:21:59.000Z | 2020-11-18T14:52:38.000Z | # Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 28.72043 | 74 | 0.67091 | # Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 111 | 1,300 | 23 |
7929cb67f574a0d18be4ad7d88be3c60517bdce5 | 1,289 | py | Python | cloudsimd/launchers/launch_utils/traffic_shaping.py | osrf/cloudsim-legacy | 01ea7dd2708ed9797a860ac839028ec62fd96a23 | [
"Apache-2.0"
] | null | null | null | cloudsimd/launchers/launch_utils/traffic_shaping.py | osrf/cloudsim-legacy | 01ea7dd2708ed9797a860ac839028ec62fd96a23 | [
"Apache-2.0"
] | null | null | null | cloudsimd/launchers/launch_utils/traffic_shaping.py | osrf/cloudsim-legacy | 01ea7dd2708ed9797a860ac839028ec62fd96a23 | [
"Apache-2.0"
] | 1 | 2021-03-16T15:00:51.000Z | 2021-03-16T15:00:51.000Z | import sshclient
from launch_db import get_constellation_data
from launch_db import log_msg
| 34.837838 | 73 | 0.671839 | import sshclient
from launch_db import get_constellation_data
from launch_db import log_msg
def log(msg, channel=__name__, severity="info"):
log_msg(msg, channel, severity)
def run_tc_command(constellation_name, machine_name_key,
keyPairName,
ip_address_key,
... | 1,149 | 0 | 46 |
dee87b225dc9554e3dce793df7d81a7dd581f3cd | 2,698 | py | Python | parser/code_blocks/AK.py | ZaldivardeA/dstv_matcher | 2899c433c42f0a265cf0b377bd257c01c53e1569 | [
"MIT"
] | 1 | 2020-12-03T16:17:56.000Z | 2020-12-03T16:17:56.000Z | parser/code_blocks/AK.py | ZaldivardeA/dstv_matcher | 2899c433c42f0a265cf0b377bd257c01c53e1569 | [
"MIT"
] | null | null | null | parser/code_blocks/AK.py | ZaldivardeA/dstv_matcher | 2899c433c42f0a265cf0b377bd257c01c53e1569 | [
"MIT"
] | null | null | null | from .general import check_for_block_tag, check_for_comment, split_info_lines, read_face_column, dimension_reference
from typing import List, Union, Any
FORMAT: List[int] = [2, 1, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10]
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12, 13,14, 15
| 32.506024 | 135 | 0.576353 | from .general import check_for_block_tag, check_for_comment, split_info_lines, read_face_column, dimension_reference
from typing import List, Union, Any
FORMAT: List[int] = [2, 1, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10]
# 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12, 13,14, 15
def get_type_n... | 2,299 | 0 | 92 |
79f80e484561d0b01952d366471c57e5bc9c0587 | 6,804 | py | Python | vessel/common/models.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | null | null | null | vessel/common/models.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | 6 | 2021-03-31T19:21:50.000Z | 2022-01-13T01:46:09.000Z | vessel/common/models.py | RaphaelPrevost/Back2Shops | 5f2d369e82fe2a7b9b3a6c55782319b23d142dfd | [
"CECILL-B"
] | null | null | null | # -*- coding: utf-8 -*-
#############################################################################
#
# Copyright © Dragon Dollar Limited
# contact: contact@dragondollar.com
#
# This software is a collection of webservices designed to provide a secure
# and scalable framework to build e-commerce websites.
#
# This s... | 41.487805 | 79 | 0.591858 | # -*- coding: utf-8 -*-
#############################################################################
#
# Copyright © Dragon Dollar Limited
# contact: contact@dragondollar.com
#
# This software is a collection of webservices designed to provide a secure
# and scalable framework to build e-commerce websites.
#
# This s... | 4,410 | 45 | 473 |
6dc89da0e6369c98d276198668c58b74f82f54d8 | 2,504 | py | Python | tests/test_smplify.py | JasonBoy1/mmhuman3d | 79b2665191115f3ed905e6afdf09990a8d484362 | [
"Apache-2.0"
] | 1 | 2021-12-03T04:17:52.000Z | 2021-12-03T04:17:52.000Z | tests/test_smplify.py | wmj142326/mmhuman3d | f107203714f9627a9308d4515d35ab8fbd0074a4 | [
"Apache-2.0"
] | null | null | null | tests/test_smplify.py | wmj142326/mmhuman3d | f107203714f9627a9308d4515d35ab8fbd0074a4 | [
"Apache-2.0"
] | null | null | null | import mmcv
import numpy as np
import torch
from mmhuman3d.core.parametric_model.builder import build_registrant
from mmhuman3d.models.builder import build_body_model
body_model_load_dir = 'data/body_models'
batch_size = 2
| 30.536585 | 79 | 0.676518 | import mmcv
import numpy as np
import torch
from mmhuman3d.core.parametric_model.builder import build_registrant
from mmhuman3d.models.builder import build_body_model
body_model_load_dir = 'data/body_models'
batch_size = 2
def test_smpl():
smplify_config = dict(mmcv.Config.fromfile('configs/smplify/smplify.py')... | 2,231 | 0 | 46 |
0aaf3087ab8b452b83ab332928e5e2e21a1d6465 | 372 | py | Python | code/03-skimage-images/Open.py | rahulisaac/image-processing | 595e702e337729844625cd6d5d8252fcc9b63a6a | [
"CC-BY-4.0"
] | 2 | 2021-01-10T17:24:07.000Z | 2021-01-11T09:34:42.000Z | code/03-skimage-images/Open.py | rahulisaac/image-processing | 595e702e337729844625cd6d5d8252fcc9b63a6a | [
"CC-BY-4.0"
] | null | null | null | code/03-skimage-images/Open.py | rahulisaac/image-processing | 595e702e337729844625cd6d5d8252fcc9b63a6a | [
"CC-BY-4.0"
] | null | null | null | """
* Python program to open, display, and save an image.
*
"""
import skimage.io
import skimage.viewer
# read image
image = skimage.io.imread(fname="chair.jpg")
# display image and wait for keypress, using a resizable window
viewer = skimage.viewer.ImageViewer(image)
viewer.show()
# save a new version in .tif for... | 21.882353 | 63 | 0.736559 | """
* Python program to open, display, and save an image.
*
"""
import skimage.io
import skimage.viewer
# read image
image = skimage.io.imread(fname="chair.jpg")
# display image and wait for keypress, using a resizable window
viewer = skimage.viewer.ImageViewer(image)
viewer.show()
# save a new version in .tif for... | 0 | 0 | 0 |
715920b78cf3a81962fdc56f128b96fd50298cad | 1,478 | py | Python | src/stance/preprocessing/make_vocab.py | emilyallaway/connotation-embedding | 7f24f4a2ad0945189dd8961f8a85b0a2d4a19f6d | [
"MIT"
] | null | null | null | src/stance/preprocessing/make_vocab.py | emilyallaway/connotation-embedding | 7f24f4a2ad0945189dd8961f8a85b0a2d4a19f6d | [
"MIT"
] | null | null | null | src/stance/preprocessing/make_vocab.py | emilyallaway/connotation-embedding | 7f24f4a2ad0945189dd8961f8a85b0a2d4a19f6d | [
"MIT"
] | null | null | null | import pandas as pd
import json
from sklearn.feature_extraction.text import CountVectorizer
import argparse
from functools import reduce
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--mode', help='What to do', required=True)
parser.add_argument('-d', '--data', h... | 28.423077 | 98 | 0.635995 | import pandas as pd
import json
from sklearn.feature_extraction.text import CountVectorizer
import argparse
from functools import reduce
def load_original(inname, col, k=None):
df = pd.read_csv(inname)
str_data = []
for i in df.index:
words = reduce(lambda x, y: x + y, json.loads(df.iloc[i][col]))... | 524 | 0 | 46 |
8fa74f5878fd6fd1f76933cccee2f6c3baac37ae | 1,268 | py | Python | toolbox/nn/DistMult.py | LinXueyuanStdio/KGE-toolbox | 916842835e61ba99dde1409592977a2ec55f8aae | [
"Apache-2.0"
] | 2 | 2021-10-17T17:50:24.000Z | 2021-12-13T05:22:46.000Z | toolbox/nn/DistMult.py | LinXueyuanStdio/KGE-toolbox | 916842835e61ba99dde1409592977a2ec55f8aae | [
"Apache-2.0"
] | null | null | null | toolbox/nn/DistMult.py | LinXueyuanStdio/KGE-toolbox | 916842835e61ba99dde1409592977a2ec55f8aae | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
| 28.818182 | 91 | 0.623028 | import torch
import torch.nn as nn
import torch.nn.functional as F
class CoreDistMult(nn.Module):
def __init__(self, input_dropout_rate=0.2):
super(CoreDistMult, self).__init__()
self.dropout = nn.Dropout(input_dropout_rate)
def forward(self, h, r):
h = self.dropout(h)
r = sel... | 1,006 | 14 | 179 |
6df03bd7229b468f7bdab1cd1fe73c6951d497a6 | 17,523 | py | Python | bot.py | dathbezumniy/kmd-sync-bot | bdc922b5b47ded2e851f16441de818a298c1394a | [
"MIT"
] | null | null | null | bot.py | dathbezumniy/kmd-sync-bot | bdc922b5b47ded2e851f16441de818a298c1394a | [
"MIT"
] | 2 | 2020-04-28T19:35:06.000Z | 2020-05-12T04:39:07.000Z | bot.py | dathbezumniy/kmd-sync-bot | bdc922b5b47ded2e851f16441de818a298c1394a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import time
import logging
import requests
from emoji import emojize
from functools import wraps
from pssh.clients import SSHClient
from pssh.exceptions import AuthenticationException
from requests.exceptions import RequestException
from telegram import ReplyKeyboardMarkup, ChatAction, ... | 41.721429 | 270 | 0.672259 | #!/usr/bin/env python3
import os
import time
import logging
import requests
from emoji import emojize
from functools import wraps
from pssh.clients import SSHClient
from pssh.exceptions import AuthenticationException
from requests.exceptions import RequestException
from telegram import ReplyKeyboardMarkup, ChatAction, ... | 12,727 | 0 | 490 |