max_stars_repo_path stringlengths 4 286 | max_stars_repo_name stringlengths 5 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.03M | content_cleaned stringlengths 6 1.03M | language stringclasses 111
values | language_score float64 0.03 1 | comments stringlengths 0 556k | edu_score float64 0.32 5.03 | edu_int_score int64 0 5 |
|---|---|---|---|---|---|---|---|---|---|---|
fpiweb/migrations/0016_remove_box_print_box_number_label.py | snelzing/Food-Pantry-Inventory | 22 | 6629451 | <reponame>snelzing/Food-Pantry-Inventory<gh_stars>10-100
# Generated by Django 2.2.1 on 2019-06-12 02:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('fpiweb', '0015_box_print_box_number_label'),
]
operations = [
migrations.RemoveField(
... | # Generated by Django 2.2.1 on 2019-06-12 02:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('fpiweb', '0015_box_print_box_number_label'),
]
operations = [
migrations.RemoveField(
model_name='box',
name='print_box_numb... | en | 0.75276 | # Generated by Django 2.2.1 on 2019-06-12 02:20 | 1.272205 | 1 |
binding.gyp | robertleeplummerjr/node-gles | 0 | 6629452 | <reponame>robertleeplummerjr/node-gles<filename>binding.gyp
##
# @license
# Copyright 2018 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... | ##
# @license
# Copyright 2018 Google Inc. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | en | 0.774568 | ## # @license # Copyright 2018 Google Inc. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ... | 1.543014 | 2 |
lifetimes/fitters/beta_geo_fitter.py | isabella232/lifetimes | 2 | 6629453 | """Beta Geo Fitter, also known as BG/NBD model."""
from __future__ import print_function
from collections import OrderedDict
import numpy as np
from numpy import log, asarray, any as npany, c_ as vconcat, isinf, isnan, \
where, exp
from numpy import ones_like
from pandas import DataFrame
from scipy.special import ... | """Beta Geo Fitter, also known as BG/NBD model."""
from __future__ import print_function
from collections import OrderedDict
import numpy as np
from numpy import log, asarray, any as npany, c_ as vconcat, isinf, isnan, \
where, exp
from numpy import ones_like
from pandas import DataFrame
from scipy.special import ... | en | 0.804262 | Beta Geo Fitter, also known as BG/NBD model. Also known as the BG/NBD model. Based on [1], this model has the following assumptions: 1) Each individual, i, has a hidden lambda_i and p_i parameter 2) These come from a population wide Gamma and a Beta distribution respectively. 3) Individuals pur... | 2.957965 | 3 |
model/models.py | cloversjtu/diri-vhred | 20 | 6629454 | import torch
import torch.nn as nn
from torch.distributions import Dirichlet
from utils import to_var, pad, normal_kl_div, normal_logpdf, \
bag_of_words_loss, to_bow, EOS_ID, dirichlet_kl_div, dirichlet_logpdf
import layers
import numpy as np
import random
import sys
VariationalModels = ['DIR_VHRED']
class DIR_VH... | import torch
import torch.nn as nn
from torch.distributions import Dirichlet
from utils import to_var, pad, normal_kl_div, normal_logpdf, \
bag_of_words_loss, to_bow, EOS_ID, dirichlet_kl_div, dirichlet_logpdf
import layers
import numpy as np
import random
import sys
VariationalModels = ['DIR_VHRED']
class DIR_VH... | en | 0.446941 | # self.prior_mu = nn.Linear(config.context_size, config.z_sent_size) # self.prior_var = nn.Linear(config.context_size, config.z_sent_size) # self.posterior_mu = nn.Linear(config.context_size, config.z_sent_size) # self.posterior_var = nn.Linear(config.context_size, config.z_sent_size) # Context dependent prior # mu_pri... | 1.992667 | 2 |
autogamess/plots/make_kde.py | Cavenfish/autogamess | 6 | 6629455 | <filename>autogamess/plots/make_kde.py
from ..config import *
import matplotlib.pyplot as plt
from ..dictionaries import theory_dict
def make_kde(data, savedir):
"""
"""
#Define Sheet names
opt = 'Optimization'
hes = 'Hessian'
ram = 'Raman'
vsc = 'VSCF'
#Define Data Column names/vari... | <filename>autogamess/plots/make_kde.py
from ..config import *
import matplotlib.pyplot as plt
from ..dictionaries import theory_dict
def make_kde(data, savedir):
"""
"""
#Define Sheet names
opt = 'Optimization'
hes = 'Hessian'
ram = 'Raman'
vsc = 'VSCF'
#Define Data Column names/vari... | en | 0.513003 | #Define Sheet names #Define Data Column names/variables #Other predefined strings #Predefine Markers and Colors | 2.4221 | 2 |
pyolite/patterns.py | PressLabs/pyolite | 23 | 6629456 | <filename>pyolite/patterns.py
USER_PATTERN = r'(\s*)([RW+DC]*)(\s*)=(\s*)%s'
CONFIG_PATTERN = r"(\s*)config(\s*)([\w\.]+)(\s*)=(\s*)([\w\.\"\@\:\/\'\%\^\&\*]+)(\s*)"
| <filename>pyolite/patterns.py
USER_PATTERN = r'(\s*)([RW+DC]*)(\s*)=(\s*)%s'
CONFIG_PATTERN = r"(\s*)config(\s*)([\w\.]+)(\s*)=(\s*)([\w\.\"\@\:\/\'\%\^\&\*]+)(\s*)"
| none | 1 | 2.136216 | 2 | |
01 prerequisites/quiz.py | abbas133/bc_riskmanagement | 0 | 6629457 | <filename>01 prerequisites/quiz.py
from cryptography.fernet import Fernet
Key = '<KEY>
# Oh no! The code is going over the edge! What are you going to do?
message = b'<KEY>
def main():
f = Fernet(Key)
print(f.decrypt(message))
if __name__ != "__main__":
main() | <filename>01 prerequisites/quiz.py
from cryptography.fernet import Fernet
Key = '<KEY>
# Oh no! The code is going over the edge! What are you going to do?
message = b'<KEY>
def main():
f = Fernet(Key)
print(f.decrypt(message))
if __name__ != "__main__":
main() | en | 0.98219 | # Oh no! The code is going over the edge! What are you going to do? | 2.663528 | 3 |
src/installer/src/tortuga/events/types/hardwareprofile.py | sutasu/tortuga | 33 | 6629458 | # Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Tags 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 wr... | # Copyright 2008-2018 Univa Corporation
#
# Licensed under the Apache License, Tags 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 wr... | en | 0.810396 | # Copyright 2008-2018 Univa Corporation # # Licensed under the Apache License, Tags 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 wr... | 2.209053 | 2 |
authors/apps/follower/tests/test_following.py | andela/ah-backend-tabs | 0 | 6629459 | from django.test import TestCase, RequestFactory
from authors.apps.authentication.views import RegistrationAPIView, VerificationAPIView
from authors.apps.follower.views import FollowAPIView, UnfollowAPIView, ListFollowers, ListFollowing
import json
import smtplib
from minimock import Mock
from authors.apps.follower.mod... | from django.test import TestCase, RequestFactory
from authors.apps.authentication.views import RegistrationAPIView, VerificationAPIView
from authors.apps.follower.views import FollowAPIView, UnfollowAPIView, ListFollowers, ListFollowing
import json
import smtplib
from minimock import Mock
from authors.apps.follower.mod... | none | 1 | 2.185694 | 2 | |
pyne/pyne/fluka.py | AllSafeCyberSecur1ty/Nuclear-Engineering | 1 | 6629460 | #!/usr/bin/python
"""Module for parsing FLUKA output data. FLUKA is a fully integrated particle
physics MonteCarlo simulation package. It has many applications in high
energy experimental physics and engineering, shielding, detector and telescope
design, cosmic ray studies, dosimetry, medical physics and radio-biology.... | #!/usr/bin/python
"""Module for parsing FLUKA output data. FLUKA is a fully integrated particle
physics MonteCarlo simulation package. It has many applications in high
energy experimental physics and engineering, shielding, detector and telescope
design, cosmic ray studies, dosimetry, medical physics and radio-biology.... | en | 0.738669 | #!/usr/bin/python Module for parsing FLUKA output data. FLUKA is a fully integrated particle physics MonteCarlo simulation package. It has many applications in high energy experimental physics and engineering, shielding, detector and telescope design, cosmic ray studies, dosimetry, medical physics and radio-biology. Fu... | 2.366442 | 2 |
common/logging_util.py | mjparker777/daemons | 1 | 6629461 | """
Use this to enable logging outside of Django
Example usage:
from common.django_needed import logging_util
# Setup daemon logging
daemon_name = "ExampleDaemon"
self.logger = logging_util.get_logger(daemon_name)
self.logger.debug('This is a debug message in the daemon log.')
# Switch to log wit... | """
Use this to enable logging outside of Django
Example usage:
from common.django_needed import logging_util
# Setup daemon logging
daemon_name = "ExampleDaemon"
self.logger = logging_util.get_logger(daemon_name)
self.logger.debug('This is a debug message in the daemon log.')
# Switch to log wit... | en | 0.593659 | Use this to enable logging outside of Django Example usage: from common.django_needed import logging_util # Setup daemon logging daemon_name = "ExampleDaemon" self.logger = logging_util.get_logger(daemon_name) self.logger.debug('This is a debug message in the daemon log.') # Switch to log with a ... | 2.334054 | 2 |
tempest/api/identity/v3/test_tokens.py | gamado/ds_tempest_rm_me_please | 0 | 6629462 | <reponame>gamado/ds_tempest_rm_me_please<filename>tempest/api/identity/v3/test_tokens.py
# Copyright 2015 OpenStack Foundation
# 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... | # Copyright 2015 OpenStack Foundation
# 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 requ... | en | 0.803463 | # Copyright 2015 OpenStack Foundation # 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 requ... | 1.861099 | 2 |
schwarz/mailqueue/maildir_utils.py | FelixSchwarz/mailqueue-runner | 3 | 6629463 | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, print_function, unicode_literals
import os
from boltons.fileutils import atomic_rename, atomic_save
import portalocker
from .compat import os_makedirs, FileNotFoundError, IS_WINDOWS
__all__ = ['create_maildir_directorie... | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
from __future__ import absolute_import, print_function, unicode_literals
import os
from boltons.fileutils import atomic_rename, atomic_save
import portalocker
from .compat import os_makedirs, FileNotFoundError, IS_WINDOWS
__all__ = ['create_maildir_directorie... | en | 0.919361 | # -*- coding: utf-8 -*- # SPDX-License-Identifier: MIT # The maildir++ description [1] mentions a "maildirfolder" file for each # subfolder. Dovecot does not create such a file but doing so seems # harmless. # http://www.courier-mta.org/imap/README.maildirquota.html # never overwrite an existing "maildirfolder" file (j... | 2.222055 | 2 |
speedcord/shard.py | MM-coder/speedcord | 0 | 6629464 | """
Created by Epic at 9/5/20
"""
from asyncio import Event, Lock, AbstractEventLoop, sleep
from aiohttp.client_exceptions import ClientConnectorError
from aiohttp import WSMessage, WSMsgType
from logging import getLogger
from sys import platform
from ujson import loads, dumps
from time import time
from .exceptions im... | """
Created by Epic at 9/5/20
"""
from asyncio import Event, Lock, AbstractEventLoop, sleep
from aiohttp.client_exceptions import ClientConnectorError
from aiohttp import WSMessage, WSMsgType
from logging import getLogger
from sys import platform
from ujson import loads, dumps
from time import time
from .exceptions im... | en | 0.886527 | Created by Epic at 9/5/20 # Some bots might wanna know which shards is online at all times # This gets modified by gateway.py # Default events # Fix typehinting # Session is no longer valid, create a new session | 1.963877 | 2 |
solutions/0090-subsets-ii/subsets-ii.py | iFun/Project-G | 0 | 6629465 | <reponame>iFun/Project-G
# Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).
#
# Note: The solution set must not contain duplicate subsets.
#
# Example:
#
#
# Input: [1,2,2]
# Output:
# [
# [2],
# [1],
# [1,2,2],
# [2,2],
# [1,2],
# [... | # Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set).
#
# Note: The solution set must not contain duplicate subsets.
#
# Example:
#
#
# Input: [1,2,2]
# Output:
# [
# [2],
# [1],
# [1,2,2],
# [2,2],
# [1,2],
# []
# ]
#
#
#
# @lc app... | en | 0.712053 | # Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). # # Note: The solution set must not contain duplicate subsets. # # Example: # # # Input: [1,2,2] # Output: # [ # [2], # [1], # [1,2,2], # [2,2], # [1,2], # [] # ] # # # # @lc app=leetcode id=90... | 3.924019 | 4 |
detect.py | ilham-bintang/ScanSSD | 0 | 6629466 | import matplotlib
matplotlib.use( 'tkagg' )
import matplotlib.pyplot as plt
import os
from collections import OrderedDict
import cv2
import numpy as np
import argparse
import torch
from torch.autograd import Variable
import torch.nn as nn
from torchvision import transforms
from scipy.ndimage.measurements import label... | import matplotlib
matplotlib.use( 'tkagg' )
import matplotlib.pyplot as plt
import os
from collections import OrderedDict
import cv2
import numpy as np
import argparse
import torch
from torch.autograd import Variable
import torch.nn as nn
from torchvision import transforms
from scipy.ndimage.measurements import label... | en | 0.513829 | # width = image.shape[0] # height = image.shape[1] # max_width = 1024 # coef = max_width/width # new_width = int(width * coef) # new_height = int(height * coef) # rimg = cv2.resize(image, (new_height, new_width), interpolation = cv2.INTER_AREA).astype(np.float32) # nn.DataParallel(net) # remove `module.` # forward pass... | 2.025214 | 2 |
Search/search.py | TarnumG95/PictureMatchCheater | 1 | 6629467 | import itertools
def preprocess(FILE):
"""
Read from file, return a int matrix surrounded by 0.
"""
ret = []
with open(FILE) as f:
for line in f:
line = line[:-1]
ret.append([(int)(arg) for arg in line.split(' ')])
return ret
def surround0(ret):
ret.insert(... | import itertools
def preprocess(FILE):
"""
Read from file, return a int matrix surrounded by 0.
"""
ret = []
with open(FILE) as f:
for line in f:
line = line[:-1]
ret.append([(int)(arg) for arg in line.split(' ')])
return ret
def surround0(ret):
ret.insert(... | en | 0.574854 | Read from file, return a int matrix surrounded by 0. # print pos1, pos2 # print myRange(pos1[1] + 1, pos2[1]) # print range(pos1[0] + 1, pos2[0]) # print (i, pos2[1]) # print 1 # print (row, pos1[1]) # print 3 # print 4 @param: board -- a matrix representing the game pos1 -- First Position, e.g. (1, 2)... | 3.775923 | 4 |
ordersystem/models/__init__.py | iomegak12/ordersystempy | 0 | 6629468 | <filename>ordersystem/models/__init__.py<gh_stars>0
from .crm_system_error import CRMSystemError
from .order import Order
| <filename>ordersystem/models/__init__.py<gh_stars>0
from .crm_system_error import CRMSystemError
from .order import Order
| none | 1 | 1.344774 | 1 | |
19.dicionarios_variaveis_compostas/ex.94.py | hermyay/Curso-de-Python | 0 | 6629469 | # Crie um programa que leia nome, sexo e idade de varias pessoas, guardando os dados de cada pessoa em um dicionario e todos os dicionarios em uma lista. No final, mostre:
# a) Quantas pessoas foram cadastradas
# b) A media de idade do grupo
# c) Uma lista com todas as pessoas com idade acima da media.
pessoas = dict(... | # Crie um programa que leia nome, sexo e idade de varias pessoas, guardando os dados de cada pessoa em um dicionario e todos os dicionarios em uma lista. No final, mostre:
# a) Quantas pessoas foram cadastradas
# b) A media de idade do grupo
# c) Uma lista com todas as pessoas com idade acima da media.
pessoas = dict(... | pt | 0.988853 | # Crie um programa que leia nome, sexo e idade de varias pessoas, guardando os dados de cada pessoa em um dicionario e todos os dicionarios em uma lista. No final, mostre: # a) Quantas pessoas foram cadastradas # b) A media de idade do grupo # c) Uma lista com todas as pessoas com idade acima da media. | 3.830308 | 4 |
tools/report_generators/cli.py | mgrubisic/coronavirus-2020 | 0 | 6629470 | <reponame>mgrubisic/coronavirus-2020
import logging
import os
from itertools import compress
import click
import pandas
import oscovida
from .executors import ReportExecutor
from .reporters import (AllRegions, CountryReport, GermanyReport,
HungaryReport, USAReport)
ALL_REGIONS = ["countries"... | import logging
import os
from itertools import compress
import click
import pandas
import oscovida
from .executors import ReportExecutor
from .reporters import (AllRegions, CountryReport, GermanyReport,
HungaryReport, USAReport)
ALL_REGIONS = ["countries", "germany", "usa", "hungary", "all-r... | en | 0.842511 | # Here we should identify regions in countries, and process those. # Instead, as a quick hack to get started, we'll just take one country # and the current "get_country" method will sum over all regions of one # country if only the country name is given. # TODO: The get_x_list methods should be part of Reporter class ... | 2.575778 | 3 |
segmentation_models_pytorch/losses/focal.py | MikePham05/segmentation_models.pytorch | 5,325 | 6629471 | from typing import Optional
from functools import partial
import torch
from torch.nn.modules.loss import _Loss
from ._functional import focal_loss_with_logits
from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE
__all__ = ["FocalLoss"]
class FocalLoss(_Loss):
def __init__(
self,
... | from typing import Optional
from functools import partial
import torch
from torch.nn.modules.loss import _Loss
from ._functional import focal_loss_with_logits
from .constants import BINARY_MODE, MULTICLASS_MODE, MULTILABEL_MODE
__all__ = ["FocalLoss"]
class FocalLoss(_Loss):
def __init__(
self,
... | en | 0.687833 | Compute Focal loss Args: mode: Loss mode 'binary', 'multiclass' or 'multilabel' alpha: Prior probability of having positive value in target. gamma: Power factor for dampening weight (focal strength). ignore_index: If not None, targets may contain values to be ign... | 2.464469 | 2 |
tyrell/enumerator/optimizer.py | rodamber/Tyrell | 0 | 6629472 | <filename>tyrell/enumerator/optimizer.py<gh_stars>0
from z3 import *
from .. import dsl as D
class Optimizer:
# additional variables to track if a production occurs or not in a program
var_occurs = []
# relaxation variables
relax_vars = []
# keeps track of the current assumptions
assumption... | <filename>tyrell/enumerator/optimizer.py<gh_stars>0
from z3 import *
from .. import dsl as D
class Optimizer:
# additional variables to track if a production occurs or not in a program
var_occurs = []
# relaxation variables
relax_vars = []
# keeps track of the current assumptions
assumption... | en | 0.889515 | # additional variables to track if a production occurs or not in a program # relaxation variables # keeps track of the current assumptions # keeps track of the cost of each relaxation variable # find positions that type-check between parent and child # not a leaf node # FIXME: reduce duplication of code # domain of the... | 2.383431 | 2 |
enthought/permissions/default/policy_data.py | enthought/etsproxy | 3 | 6629473 | # proxy module
from __future__ import absolute_import
from apptools.permissions.default.policy_data import *
| # proxy module
from __future__ import absolute_import
from apptools.permissions.default.policy_data import *
| es | 0.125187 | # proxy module | 1.076759 | 1 |
TelegramDownloader/TelegramDownloader.py | joas77/AnimeMovieDown | 0 | 6629474 | <filename>TelegramDownloader/TelegramDownloader.py
import json
from telethon import TelegramClient, client, events
from telethon.tl.types import InputMessagesFilterDocument, InputMessagesFilterVideo
from telethon.utils import get_display_name
class TelegramDownloader:
def __init__(self, api_id, api_hash) -> None:
... | <filename>TelegramDownloader/TelegramDownloader.py
import json
from telethon import TelegramClient, client, events
from telethon.tl.types import InputMessagesFilterDocument, InputMessagesFilterVideo
from telethon.utils import get_display_name
class TelegramDownloader:
def __init__(self, api_id, api_hash) -> None:
... | en | 0.705702 | #TODO: remove dialogs limit #InputMessagesFilterVideo) # TODO: get api id and hash from condig file # TODO where is the script going to be executed # how to set path | 2.505648 | 3 |
437/Pathofsum-III.py | cccccccccccccc/Myleetcode | 0 | 6629475 | # Definition for a binary tree node.
"""
timecomplexity = O(n) spacecomplexity = O(n)
Using a dict to store prefix sum occurs so far
let sum = from root to cur node val's sum
check how many prefix sums equal to sum - target
then there are same number of subpath that subpathsum = target
remember that when return from s... | # Definition for a binary tree node.
"""
timecomplexity = O(n) spacecomplexity = O(n)
Using a dict to store prefix sum occurs so far
let sum = from root to cur node val's sum
check how many prefix sums equal to sum - target
then there are same number of subpath that subpathsum = target
remember that when return from s... | en | 0.785891 | # Definition for a binary tree node. timecomplexity = O(n) spacecomplexity = O(n) Using a dict to store prefix sum occurs so far let sum = from root to cur node val's sum check how many prefix sums equal to sum - target then there are same number of subpath that subpathsum = target remember that when return from subre... | 3.688837 | 4 |
pt/vmz/models/embedding.py | opqi/VMZ | 0 | 6629476 | <filename>pt/vmz/models/embedding.py
import torch.nn as nn
import torch
class LearnedPositionalEmbedding(nn.Module):
def __init__(self, d_model, max_len=512):
super().__init__()
pe = torch.zeros(max_len, d_model).float().to(device='cuda')
pe.require_grad = True
pe = pe.unsqueeze(0)... | <filename>pt/vmz/models/embedding.py
import torch.nn as nn
import torch
class LearnedPositionalEmbedding(nn.Module):
def __init__(self, d_model, max_len=512):
super().__init__()
pe = torch.zeros(max_len, d_model).float().to(device='cuda')
pe.require_grad = True
pe = pe.unsqueeze(0)... | none | 1 | 2.527148 | 3 | |
wand/compat.py | claudep/wand | 0 | 6629477 | <gh_stars>0
""":mod:`wand.compat` --- Compatibility layer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides several subtle things to support
multiple Python versions (2.7, 3.3+) and VM implementations
(CPython, PyPy).
"""
import collections
try:
import collections.abc
except ImportError:
pass... | """:mod:`wand.compat` --- Compatibility layer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides several subtle things to support
multiple Python versions (2.7, 3.3+) and VM implementations
(CPython, PyPy).
"""
import collections
try:
import collections.abc
except ImportError:
pass
import cont... | en | 0.419397 | :mod:`wand.compat` --- Compatibility layer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides several subtle things to support multiple Python versions (2.7, 3.3+) and VM implementations (CPython, PyPy). #: (:class:`bool`) Whether it is Python 3.x or not. #: (:class:`module`) Module containing abstract... | 2.29255 | 2 |
battery-ffi/examples/ffi.py | fossabot/rust-battery | 0 | 6629478 | <reponame>fossabot/rust-battery
#!/usr/bin/env python
"""
This is an example of FFI bindings for `battery-ffi` library.
Call it similar to this:
```
$ LD_LIBRARY_PATH=../../target/debug/ ./ffi.py
```
`battery-ffi` crate should be built before that.
"""
import sys
import ctypes
prefix = {'win32': ''}.get(sys.platf... | #!/usr/bin/env python
"""
This is an example of FFI bindings for `battery-ffi` library.
Call it similar to this:
```
$ LD_LIBRARY_PATH=../../target/debug/ ./ffi.py
```
`battery-ffi` crate should be built before that.
"""
import sys
import ctypes
prefix = {'win32': ''}.get(sys.platform, 'lib')
extension = {'darwin... | en | 0.759803 | #!/usr/bin/env python This is an example of FFI bindings for `battery-ffi` library. Call it similar to this: ``` $ LD_LIBRARY_PATH=../../target/debug/ ./ffi.py ``` `battery-ffi` crate should be built before that. # # Wrappers around opaque pointers # # # Bindings for exported functions # | 2.1603 | 2 |
DataWorkflow/data_core/migrations/0006_file_model_etag_refactor.py | Swiss-Polar-Institute/data-workflow | 0 | 6629479 | # Generated by Django 2.2.6 on 2019-10-24 14:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_core', '0005_adds_sha1_in_abstract_file'),
]
operations = [
migrations.RemoveField(
model_name='file',
name='md... | # Generated by Django 2.2.6 on 2019-10-24 14:51
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('data_core', '0005_adds_sha1_in_abstract_file'),
]
operations = [
migrations.RemoveField(
model_name='file',
name='md... | en | 0.823006 | # Generated by Django 2.2.6 on 2019-10-24 14:51 | 1.595657 | 2 |
packages/performance/management/tasks/task_system.py | elicharlese/DeFi-Dashboard | 0 | 6629480 | from task_functions import *
'''NO GLOBAL VALUES'''
the_menu = {"L": "List", "A": "Add", "U": "Update", "D": "Delete", "S": "Save the data to file",
"R": "Restore data from file", "Q": "Quit this program"} # dictionary of menu options # FIXME: automate_management()
all_tasks = [
{
"name": "Ca... | from task_functions import *
'''NO GLOBAL VALUES'''
the_menu = {"L": "List", "A": "Add", "U": "Update", "D": "Delete", "S": "Save the data to file",
"R": "Restore data from file", "Q": "Quit this program"} # dictionary of menu options # FIXME: automate_management()
all_tasks = [
{
"name": "Ca... | en | 0.51412 | NO GLOBAL VALUES # dictionary of menu options # FIXME: automate_management() # list_menu will contain the "List" menu suboptions # priority_map will contain the mapping of the integer priority values to their textual interpretation # to allow us to input lower- or upper-case letters # Pause before going back to the mai... | 3.75094 | 4 |
app/core/models.py | dhruv-ahuja/todo-django | 0 | 6629481 | <reponame>dhruv-ahuja/todo-django<filename>app/core/models.py
from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Task(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
description = models.CharField(max_length=200)
comp... | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Task(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
description = models.CharField(max_length=200)
completed = models.BooleanField(default=False)
added_at = mode... | en | 0.963489 | # Create your models here. | 2.258659 | 2 |
lyapy/lyapunov_functions/quadratic_control_lyapunov_function.py | vdorobantu/lyapy | 36 | 6629482 | """Class for Control Lyapunov Functions (CLFs) of the form V(eta) = eta' P eta."""
from numpy import dot, identity
from numpy.linalg import eigvals
from scipy.linalg import solve_continuous_are, solve_continuous_lyapunov
from .control_lyapunov_function import ControlLyapunovFunction
from .quadratic_lyapunov_function ... | """Class for Control Lyapunov Functions (CLFs) of the form V(eta) = eta' P eta."""
from numpy import dot, identity
from numpy.linalg import eigvals
from scipy.linalg import solve_continuous_are, solve_continuous_lyapunov
from .control_lyapunov_function import ControlLyapunovFunction
from .quadratic_lyapunov_function ... | en | 0.563419 | Class for Control Lyapunov Functions (CLFs) of the form V(eta) = eta' P eta. Class for Control Lyapunov Functions (CLFs) of the form V(eta) = eta' P eta. Let n be the number of states, m be the number of inputs, p be the output vector size. Attributes: Control task output, output: AffineDynamicOutput ... | 3.226904 | 3 |
src/wa_kat/analyzers/shared.py | WebArchivCZ/WA-KAT | 3 | 6629483 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import dhtmlparser
from source_string import SourceString
# Functions & classes =========================================================
def parse_meta... | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import dhtmlparser
from source_string import SourceString
# Functions & classes =========================================================
def parse_meta... | en | 0.403894 | #! /usr/bin/env python # -*- coding: utf-8 -*- # # Interpreter version: python 2.7 # # Imports ===================================================================== # Functions & classes ========================================================= Return list of strings parsed from `content` attribute from ``<meta>`` ... | 2.640811 | 3 |
course_app/api/serializers.py | maks-nurgazy/student-attendance-menegement | 0 | 6629484 | from django.db import IntegrityError
from rest_framework import serializers
from course_app.models import Course, Enrolled, CourseApprove
from users.models import Student, Teacher
class CourseRelatedField(serializers.RelatedField):
def to_internal_value(self, data):
try:
course = self.querys... | from django.db import IntegrityError
from rest_framework import serializers
from course_app.models import Course, Enrolled, CourseApprove
from users.models import Student, Teacher
class CourseRelatedField(serializers.RelatedField):
def to_internal_value(self, data):
try:
course = self.querys... | none | 1 | 2.323854 | 2 | |
pulsar/client/server_interface.py | bgruening/pulsar | 1 | 6629485 | import logging
from abc import ABCMeta
from abc import abstractmethod
from io import BytesIO
from string import Template
from urllib.parse import urlencode, urljoin
from galaxy.util import unicodify
from .util import copy_to_path
log = logging.getLogger(__name__)
class PulsarInterface(metaclass=ABCMeta):
"""
... | import logging
from abc import ABCMeta
from abc import abstractmethod
from io import BytesIO
from string import Template
from urllib.parse import urlencode, urljoin
from galaxy.util import unicodify
from .util import copy_to_path
log = logging.getLogger(__name__)
class PulsarInterface(metaclass=ABCMeta):
"""
... | en | 0.80979 | Abstract base class describes how synchronous client communicates with (potentially remote) Pulsar procedures. Obvious implementation is HTTP based but Pulsar objects wrapped in routes can also be directly communicated with if in memory. Execute the correspond command against configured Pulsar job manager. ... | 2.412095 | 2 |
dlfairness/other/bias_result_display/2_0_baseline_vs_other.py | lin-tan/fairness-variance | 0 | 6629486 | <gh_stars>0
# Baseline vs. others
# One model, one metric per graph
import matplotlib.pyplot as plt
import yaml
from pathlib import Path
from abbrs import prefix_abbr, setting_abbr, metric_abbr, metric_display
needed_paper_list = ['EffStrategies', 'FairALM-CelebA', 'NIFR']
needed_setting_list = ['S-Base', 'S-GR', ... | # Baseline vs. others
# One model, one metric per graph
import matplotlib.pyplot as plt
import yaml
from pathlib import Path
from abbrs import prefix_abbr, setting_abbr, metric_abbr, metric_display
needed_paper_list = ['EffStrategies', 'FairALM-CelebA', 'NIFR']
needed_setting_list = ['S-Base', 'S-GR', 'A-Base', 'A... | en | 0.304696 | # Baseline vs. others # One model, one metric per graph # {(setting, bias_metric): {stat: value}} # {(setting, bias_metric): [value (each run)]} fig = plt.figure() ax = fig.subplots(1, 1) values = [] labels = [] for setting in all_settings: values.append(float(overall_stat[(s... | 2.20875 | 2 |
arp_spoofer.py | ReyhaneAbtahi/ARP-Spoofer | 0 | 6629487 | <filename>arp_spoofer.py<gh_stars>0
from scapy.all import Ether, ARP, srp, send
import time
def get_mac(ip):
ans, _ = srp(Ether(dst='ff:ff:ff:ff:ff:ff') /
ARP(pdst=ip), timeout=3, verbose=0)
if ans:
return ans[0][1].src
def spoof(target_ip, spoof_ip, verbose=True):
packet = ARP(... | <filename>arp_spoofer.py<gh_stars>0
from scapy.all import Ether, ARP, srp, send
import time
def get_mac(ip):
ans, _ = srp(Ether(dst='ff:ff:ff:ff:ff:ff') /
ARP(pdst=ip), timeout=3, verbose=0)
if ans:
return ans[0][1].src
def spoof(target_ip, spoof_ip, verbose=True):
packet = ARP(... | none | 1 | 2.948661 | 3 | |
python/day_16.py | benedwards14/Advent-of-Code-2020 | 0 | 6629488 | import dataclasses
import numpy
import re
from typing import Dict, List, Set, Tuple
import utils
@dataclasses.dataclass(frozen=True)
class TicketField:
name: str
range: Set[int]
@dataclasses.dataclass
class Ticket:
fields: List[int]
def parse_ticket_fields(ticket_field_strs: List[s... | import dataclasses
import numpy
import re
from typing import Dict, List, Set, Tuple
import utils
@dataclasses.dataclass(frozen=True)
class TicketField:
name: str
range: Set[int]
@dataclasses.dataclass
class Ticket:
fields: List[int]
def parse_ticket_fields(ticket_field_strs: List[s... | none | 1 | 2.997648 | 3 | |
irrigator_pro/contact_info/templatetags/phone_filters.py | warnes/irrigatorpro | 0 | 6629489 | <reponame>warnes/irrigatorpro
from django import template
register = template.Library()
@register.filter(expects_localtime=True)
def us_number(value):
if (len(value) != 10):
return value
return "(" + value[0:3] + ") " + value[3:6] + "-" + value[6:10]
| from django import template
register = template.Library()
@register.filter(expects_localtime=True)
def us_number(value):
if (len(value) != 10):
return value
return "(" + value[0:3] + ") " + value[3:6] + "-" + value[6:10] | none | 1 | 2.187031 | 2 | |
control/tests/convert_test.py | josephcslater/python-control | 1 | 6629490 | <filename>control/tests/convert_test.py
#!/usr/bin/env python
"""convert_test.py
Test state space and transfer function conversion.
Currently, this unit test script is not complete. It converts several random
state spaces back and forth between state space and transfer function
representations. Ideally, it should ... | <filename>control/tests/convert_test.py
#!/usr/bin/env python
"""convert_test.py
Test state space and transfer function conversion.
Currently, this unit test script is not complete. It converts several random
state spaces back and forth between state space and transfer function
representations. Ideally, it should ... | en | 0.874074 | #!/usr/bin/env python convert_test.py Test state space and transfer function conversion. Currently, this unit test script is not complete. It converts several random state spaces back and forth between state space and transfer function representations. Ideally, it should be able to assert that the conversion output... | 2.967863 | 3 |
NetTrade/__init__.py | zpoint/NetTrade | 27 | 6629491 | """NetTrade tools"""
__version__ = '1.0.3'
| """NetTrade tools"""
__version__ = '1.0.3'
| en | 0.458184 | NetTrade tools | 1.069138 | 1 |
salt/states/docker_network.py | dmyerscough/salt | 0 | 6629492 | <gh_stars>0
# -*- coding: utf-8 -*-
'''
Management of Docker networks
.. versionadded:: 2017.7.0
:depends: docker_ Python module
.. note::
Older releases of the Python bindings for Docker were called docker-py_ in
PyPI. All releases of docker_, and releases of docker-py_ >= 1.6.0 are
supported. These pyt... | # -*- coding: utf-8 -*-
'''
Management of Docker networks
.. versionadded:: 2017.7.0
:depends: docker_ Python module
.. note::
Older releases of the Python bindings for Docker were called docker-py_ in
PyPI. All releases of docker_, and releases of docker-py_ >= 1.6.0 are
supported. These python bindings... | en | 0.870484 | # -*- coding: utf-8 -*- Management of Docker networks .. versionadded:: 2017.7.0 :depends: docker_ Python module .. note:: Older releases of the Python bindings for Docker were called docker-py_ in PyPI. All releases of docker_, and releases of docker-py_ >= 1.6.0 are supported. These python bindings can... | 2.140018 | 2 |
tests/decorators.py | AFriemann/simple_tools | 1 | 6629493 | <reponame>AFriemann/simple_tools<filename>tests/decorators.py
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
.. module:: TODO
:platform: Unix
:synopsis: TODO.
.. moduleauthor:: <NAME> <EMAIL>
"""
import unittest
import time
from simple_tools.decorators.errors import not_implemented
from simple_tools.deco... | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
.. module:: TODO
:platform: Unix
:synopsis: TODO.
.. moduleauthor:: <NAME> <EMAIL>
"""
import unittest
import time
from simple_tools.decorators.errors import not_implemented
from simple_tools.decorators.time import timeout
from simple_tools.exceptions import... | en | 0.144085 | #! /usr/bin/env python3 # -*- coding: utf-8 -*- .. module:: TODO :platform: Unix :synopsis: TODO. .. moduleauthor:: <NAME> <EMAIL> # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 fenc=utf-8 | 2.43755 | 2 |
net_sphere.py | ntubiolin/InsightFace_Pytorch | 0 | 6629494 | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn import Parameter
import math
def myphi(x,m):
x = x * m
return 1-x**2/math.factorial(2)+x**4/math.factorial(4)-x**6/math.factorial(6) + \
x**8/math.factorial(8) - x**9/math.factorial(... | import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
from torch.nn import Parameter
import math
def myphi(x,m):
x = x * m
return 1-x**2/math.factorial(2)+x**4/math.factorial(4)-x**6/math.factorial(6) + \
x**8/math.factorial(8) - x**9/math.factorial(... | en | 0.266771 | # size=(B,F) F is feature len # size=(F,Classnum) F=in_features Classnum=out_features # size=B # size=Classnum # size=(B,Classnum) # size=(B,Classnum,2) #size=(B,1) #size=(B,Classnum) #size=(B,Classnum) #input = B*3*112*96 #=>B*64*56*48 #=>B*128*28*24 #=>B*128*28*24 #=>B*256*14*12 #=>B*256*14*12 # =>B*256*14*12 # =>... | 2.421421 | 2 |
finrl_meta/data_processors/processor_binance.py | ihopethiswillfi/FinRL-Meta | 0 | 6629495 | <filename>finrl_meta/data_processors/processor_binance.py
import pandas as pd
import requests
import json
from datetime import datetime,timedelta
from talib.abstract import MACD, RSI, CCI, DX
import numpy as np
class BinanceProcessor():
def __init__(self):
self.url = "https://api.binance.com/api/v3/klines"... | <filename>finrl_meta/data_processors/processor_binance.py
import pandas as pd
import requests
import json
from datetime import datetime,timedelta
from talib.abstract import MACD, RSI, CCI, DX
import numpy as np
class BinanceProcessor():
def __init__(self):
self.url = "https://api.binance.com/api/v3/klines"... | en | 0.739992 | #main functions #price_ary = df[df.tic==tic]['close'].values # helper functions # For debugging purposes, uncomment these lines and if they throw an error # then you may have an error in req_params # r = requests.get(self.url, params=req_params) # print(r.text) # No stock split and dividend announcement, hence close is... | 2.726784 | 3 |
Unsupervised Machine Learning Algorithms/PCA.py | mikema2019/Machine-learning-algorithms | 0 | 6629496 | <reponame>mikema2019/Machine-learning-algorithms
import numpy as np
from sklearn import decomposition
from sklearn.datasets import load_iris
class PCA():
#C=np.transpose(D.T.dot(X_train.T))
#X=C.dot(D.T)
def __init__(self,n_component):
self.n_component=n_component
def... | import numpy as np
from sklearn import decomposition
from sklearn.datasets import load_iris
class PCA():
#C=np.transpose(D.T.dot(X_train.T))
#X=C.dot(D.T)
def __init__(self,n_component):
self.n_component=n_component
def train(self,X_train):
train_no,feature_n... | en | 0.393237 | #C=np.transpose(D.T.dot(X_train.T)) #X=C.dot(D.T) # # print(X_train) | 2.837742 | 3 |
src/yapcad/geometry.py | rdevaul/yapCAD | 18 | 6629497 | <filename>src/yapcad/geometry.py
## yapCAD geometry-generating superclass
## =====================================
## subclasses of Geometry implement the geom() method, which produce
## geometry lists or computational geometry primitives, as described
## by the functions in geom.py
## subclasses of SampleGeometry im... | <filename>src/yapcad/geometry.py
## yapCAD geometry-generating superclass
## =====================================
## subclasses of Geometry implement the geom() method, which produce
## geometry lists or computational geometry primitives, as described
## by the functions in geom.py
## subclasses of SampleGeometry im... | en | 0.799155 | ## yapCAD geometry-generating superclass ## ===================================== ## subclasses of Geometry implement the geom() method, which produce ## geometry lists or computational geometry primitives, as described ## by the functions in geom.py ## subclasses of SampleGeometry implelement geom() and sample() ## me... | 2.714719 | 3 |
parellel_computing/tmp.py | fly2rain/try_git_pycharm | 0 | 6629498 | import threading
import time
number = 0
lock = threading.Lock()
def plus(lk):
global number # global声明此处的number是外面的全局变量number
lk.acquire() # 开始加锁
for _ in range(1000000): # 进行一个大数级别的循环加一运算
number += 1
print("子线程%s运算结束后,number = %s" % (threading.current_thread().getName(), number))
lk.r... | import threading
import time
number = 0
lock = threading.Lock()
def plus(lk):
global number # global声明此处的number是外面的全局变量number
lk.acquire() # 开始加锁
for _ in range(1000000): # 进行一个大数级别的循环加一运算
number += 1
print("子线程%s运算结束后,number = %s" % (threading.current_thread().getName(), number))
lk.r... | zh | 0.829273 | # global声明此处的number是外面的全局变量number # 开始加锁 # 进行一个大数级别的循环加一运算 # 释放锁,让别的线程也可以访问number # 用2个子线程,就可以观察到脏数据 # 🔥🔥需要把锁当做参数传递给plus函数,注意传递对象🔥🔥🔥 # 等待2秒,确保2个子线程都已经结束运算。 | 3.599379 | 4 |
Turtle/Turtles_Race_game_en.py | sagarbabalsure/pythonCodes | 65 | 6629499 | #Turtle Race Game :
#added by Heba-Ahmad
#This is a turtle game, that turtles will race against each other
#the code of the game with readable comments:
from turtle import *
from random import randint
#screen setup:
wn = Screen()
wn.bgcolor("green yellow")
wn.title("Turtles Race")
wn.setup(width = 500, height= 500)
... | #Turtle Race Game :
#added by Heba-Ahmad
#This is a turtle game, that turtles will race against each other
#the code of the game with readable comments:
from turtle import *
from random import randint
#screen setup:
wn = Screen()
wn.bgcolor("green yellow")
wn.title("Turtles Race")
wn.setup(width = 500, height= 500)
... | en | 0.87842 | #Turtle Race Game : #added by Heba-Ahmad #This is a turtle game, that turtles will race against each other #the code of the game with readable comments: #screen setup: #to write on the screen #turtle objects setup: #a race track #the track lines dashed instead of solid (for solid: add forward(150) instead of the loop a... | 4.443892 | 4 |
ABC043/D.py | shimomura314/AtcoderCodes | 0 | 6629500 | s = list(input())
n = len(s)
for i in range(n-1):
if s[i] == s[i+1]:
print(i+1, i+2)
exit()
for i in range(n-2):
if s[i] == s[i+2]:
print(i+1, i+3)
exit()
print(-1, -1) | s = list(input())
n = len(s)
for i in range(n-1):
if s[i] == s[i+1]:
print(i+1, i+2)
exit()
for i in range(n-2):
if s[i] == s[i+2]:
print(i+1, i+3)
exit()
print(-1, -1) | none | 1 | 3.347275 | 3 | |
benchmark/lue/benchmark/weak_scaling/post_process.py | computationalgeography/lue | 2 | 6629501 | <reponame>computationalgeography/lue
# -*- encoding: utf8 -*-
from .weak_scaling_experiment import WeakScalingExperiment
from .. import dataset
from .. import job
from .. import plot
from .. import util
import lue.data_model as ldm
import dateutil.parser
import matplotlib
import matplotlib.pyplot as plt
import numpy a... | # -*- encoding: utf8 -*-
from .weak_scaling_experiment import WeakScalingExperiment
from .. import dataset
from .. import job
from .. import plot
from .. import util
import lue.data_model as ldm
import dateutil.parser
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
def post_process_raw_results(
... | en | 0.83946 | # -*- encoding: utf8 -*- Create plots and tables from raw benchmark results # The time point at which the experiment was performed is the epoch # of the time domain used to store the durations # String containing time point in local time zone and conventions # time_point = time_point.astimezone(tzlocal.get_localzone())... | 2.181467 | 2 |
homeassistant/components/netatmo/media_source.py | JonahKr/core | 0 | 6629502 | """Netatmo Media Source Implementation."""
import datetime as dt
import re
from typing import Optional, Tuple
from homeassistant.components.media_player.const import MEDIA_TYPE_VIDEO
from homeassistant.components.media_player.errors import BrowseError
from homeassistant.components.media_source.const import MEDIA_MIME_... | """Netatmo Media Source Implementation."""
import datetime as dt
import re
from typing import Optional, Tuple
from homeassistant.components.media_player.const import MEDIA_TYPE_VIDEO
from homeassistant.components.media_player.errors import BrowseError
from homeassistant.components.media_source.const import MEDIA_MIME_... | en | 0.690068 | Netatmo Media Source Implementation. Set up Netatmo media source. Provide Netatmo camera recordings as media sources. Initialize Netatmo source. Resolve media to a url. Return media. Browse media. # Append first level children Remove html tags from string. Parse identifier. | 2.208966 | 2 |
vistrails/packages/vtk/pythonclass.py | remram44/VisTrails-mybinder | 1 | 6629503 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: <EMAIL>
##
## This file is part of VisTrails.
##
## "Redistributio... | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: <EMAIL>
##
## This file is part of VisTrails.
##
## "Redistributio... | en | 0.613688 | ############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: <EMAIL> ## ## This file is part of VisTrails. ## ## "Redistributio... | 0.96853 | 1 |
metaflow/datastore/__init__.py | savingoyal/metaflow | 2 | 6629504 | <reponame>savingoyal/metaflow
from .inputs import Inputs
from .flow_datastore import FlowDataStore
from .datastore_set import TaskDataStoreSet
from .local_storage import LocalStorage
from .s3_storage import S3Storage
DATASTORES = {"local": LocalStorage, "s3": S3Storage}
| from .inputs import Inputs
from .flow_datastore import FlowDataStore
from .datastore_set import TaskDataStoreSet
from .local_storage import LocalStorage
from .s3_storage import S3Storage
DATASTORES = {"local": LocalStorage, "s3": S3Storage} | none | 1 | 1.24912 | 1 | |
utils/build_scripts/gdb-filter.py | victor001P/oxen-core | 128 | 6629505 | <reponame>victor001P/oxen-core
def exit_handler (event):
"""
write exit code of the program running in gdb to a file called exit.out.txt
"""
code = 1
if hasattr(event, "exit_code"):
code = event.exit_code
with open("exit.out.txt", 'w') as f:
f.write("{}".format(code))
def gdb_ex... | def exit_handler (event):
"""
write exit code of the program running in gdb to a file called exit.out.txt
"""
code = 1
if hasattr(event, "exit_code"):
code = event.exit_code
with open("exit.out.txt", 'w') as f:
f.write("{}".format(code))
def gdb_execmany(*cmds):
"""
run ... | en | 0.915944 | write exit code of the program running in gdb to a file called exit.out.txt run multiple gdb commands handle a crash from the program running in gdb # poop out log file for stack trace of all threads # quit gdb # set up event handlers to catch shit # run settings setup # run program and exit | 3.027805 | 3 |
apple/internal/macos_rules.bzl | cclauss/rules_apple | 2 | 6629506 | <reponame>cclauss/rules_apple
# Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | # Copyright 2018 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | en | 0.793364 | # Copyright 2018 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la... | 1.729052 | 2 |
setup.py | mizukasai/shap | 0 | 6629507 | from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
# to publish use:
# > python setup.py sdist upload
# which depends on ~/.pypirc
# Extend the default build_ext class to bootstrap numpy installation
# that are needed to build C extensions.
# see https://stackover... | from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
# to publish use:
# > python setup.py sdist upload
# which depends on ~/.pypirc
# Extend the default build_ext class to bootstrap numpy installation
# that are needed to build C extensions.
# see https://stackover... | en | 0.857019 | # to publish use: # > python setup.py sdist upload # which depends on ~/.pypirc # Extend the default build_ext class to bootstrap numpy installation # that are needed to build C extensions. # see https://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py Fails gracefully when various i... | 1.936514 | 2 |
modules/say_module.py | BigFlubba/Reco-PC-Server | 1 | 6629508 | <reponame>BigFlubba/Reco-PC-Server<gh_stars>1-10
# Module: say
# Description: Uses powershell and a TTS engine to make your computer say something
# Usage: !say "Something to say"
# Dependencies: time, os
import os, asyncio, configs
from lib.reco_embeds import recoEmbeds as rm
async def say(ctx, txt,noti=True):
... | # Module: say
# Description: Uses powershell and a TTS engine to make your computer say something
# Usage: !say "Something to say"
# Dependencies: time, os
import os, asyncio, configs
from lib.reco_embeds import recoEmbeds as rm
async def say(ctx, txt,noti=True):
if configs.operating_sys == "Windows":
i... | en | 0.830721 | # Module: say # Description: Uses powershell and a TTS engine to make your computer say something # Usage: !say "Something to say" # Dependencies: time, os | 2.959354 | 3 |
sovtokenfees/sovtokenfees/test/helpers/test/test_helper_request.py | burdettadam/token-plugin | 9 | 6629509 | <reponame>burdettadam/token-plugin
import pytest
from plenum.common.constants import (ROLE, TARGET_NYM, TRUSTEE, TRUSTEE_STRING,
VERKEY, NYM)
from plenum.common.txn_util import get_payload_data
from sovtoken.constants import ADDRESS, AMOUNT
def get_nym_details(helpers, dest):
... | import pytest
from plenum.common.constants import (ROLE, TARGET_NYM, TRUSTEE, TRUSTEE_STRING,
VERKEY, NYM)
from plenum.common.txn_util import get_payload_data
from sovtoken.constants import ADDRESS, AMOUNT
def get_nym_details(helpers, dest):
nym_req_handler = helpers.node.ny... | none | 1 | 1.993155 | 2 | |
project1/urls.py | iogolla/My_first_django_project | 0 | 6629510 | from django.urls import include
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from django.urls import include
import project1.views as views
urlpatterns = [
path('', views.index, name='index'),
]
| from django.urls import include
from django.contrib import admin
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from django.urls import include
import project1.views as views
urlpatterns = [
path('', views.index, name='index'),
]
| none | 1 | 1.481402 | 1 | |
First course/1st semester/matrix (2).py | tekcellat/University | 0 | 6629511 | b = map(int(input('Введите количество элементов в матрице')))
if b <4:
print('dont E matric')
elif b == 4:
x1,y1 = map(int(input('1ya stroka').split( )))
x2,y2 = map(int(input('2ya stroka').split( )))
D=x1*y2-x2*y1
print('Opred matrix',D)
| b = map(int(input('Введите количество элементов в матрице')))
if b <4:
print('dont E matric')
elif b == 4:
x1,y1 = map(int(input('1ya stroka').split( )))
x2,y2 = map(int(input('2ya stroka').split( )))
D=x1*y2-x2*y1
print('Opred matrix',D)
| none | 1 | 3.437756 | 3 | |
rainbow/runners/airflow/dag/rainbow_dags.py | liorsav/rainbow-1 | 0 | 6629512 | <gh_stars>0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License");... | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | en | 0.858686 | # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not... | 2.023278 | 2 |
numismatics/coinmarketcap.py | wade-crys/crys-backend | 0 | 6629513 | from config.api_keys import COINMARKETCAP_API_KEY
import requests
import json
latest_url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=<KEY>'
r = requests.get(latest_url)
coins_response = json.loads(r.text)
coins = coins_response['data']
with open('coins.json', 'w') as f:
... | from config.api_keys import COINMARKETCAP_API_KEY
import requests
import json
latest_url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=<KEY>'
r = requests.get(latest_url)
coins_response = json.loads(r.text)
coins = coins_response['data']
with open('coins.json', 'w') as f:
... | en | 0.365979 | # join info together # # with open('coins.json', 'r') as coins_file, open('coins_metadata.json', 'r') as coins_metadata_file: # coins = json.load(coins_file) # coins_metadata = json.load(coins_metadata_file) # find coin by id | 2.578327 | 3 |
extentions.py | FoxyTheKing/cats-blender-plugin | 0 | 6629514 | <gh_stars>0
from .tools import common as Common
from .tools import atlas as Atlas
from .tools import eyetracking as Eyetracking
from .tools import rootbone as Rootbone
from .tools import settings as Settings
from .tools import importer as Importer
from bpy.types import Scene, Material
from bpy.props import BoolPropert... | from .tools import common as Common
from .tools import atlas as Atlas
from .tools import eyetracking as Eyetracking
from .tools import rootbone as Rootbone
from .tools import settings as Settings
from .tools import importer as Importer
from bpy.types import Scene, Material
from bpy.props import BoolProperty, EnumPrope... | en | 0.662556 | # Decimation # Eye Tracking # Visemes # Bone Parenting # Optimize # Atlas # Material.add_to_atlas = BoolProperty( # description='Add this material to the atlas', # default=False # ) # Scene.material_list_index = IntProperty( # default=0 # ) # Scene.material_list = CollectionProperty( # type=Atlas.Materi... | 1.747107 | 2 |
game/ghdialogue/ghdview.py | marblexu/gearhead-caramel | 0 | 6629515 | <reponame>marblexu/gearhead-caramel
import pbge
import pygame
from pbge import my_state,draw_text,default_border,anim_delay
import gears
class ConvoVisualizer(object):
# The visualizer is a class used by the conversation when conversing.
# It has a "text" property and "render", "get_menu" methods.
TEXT_AR... | import pbge
import pygame
from pbge import my_state,draw_text,default_border,anim_delay
import gears
class ConvoVisualizer(object):
# The visualizer is a class used by the conversation when conversing.
# It has a "text" property and "render", "get_menu" methods.
TEXT_AREA = pbge.frects.Frect(0,-125,350,15... | en | 0.913531 | # The visualizer is a class used by the conversation when conversing. # It has a "text" property and "render", "get_menu" methods. | 2.801221 | 3 |
core/typecheck/typing.py | xieguo/sublime_db | 1 | 6629516 | <gh_stars>1-10
TYPE_CHECKING = False
class Any:
pass
class _GetAttr(type):
def __getitem__(self, x):
return self
class Generic(metaclass=_GetAttr):
pass
class Generator(Generic):
pass
class Callable(Generic):
pass
class List(Generic):
pass
class Optional(Generic):
pass
class Tuple... | TYPE_CHECKING = False
class Any:
pass
class _GetAttr(type):
def __getitem__(self, x):
return self
class Generic(metaclass=_GetAttr):
pass
class Generator(Generic):
pass
class Callable(Generic):
pass
class List(Generic):
pass
class Optional(Generic):
pass
class Tuple(Generic):
p... | none | 1 | 2.822477 | 3 | |
utils/info_md.py | marzoul/prjxray | 11 | 6629517 | <gh_stars>10-100
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import argparse
imp... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import argparse
import hashlib
impor... | en | 0.730122 | #!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC Module for generating the Info.md fil... | 2.273039 | 2 |
ex086b.py | lucaspereirag/pythonProject | 0 | 6629518 | <filename>ex086b.py
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for linha in range(0, 3):
for coluna in range(0, 3):
matriz[linha][coluna] = (int(input(f'Número [{linha}][{coluna}]: ')))
for linha in range(0, 3):
for coluna in range(0, 3):
print(f'[{matriz[linha][coluna]:^5}]',end='')
prin... | <filename>ex086b.py
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
for linha in range(0, 3):
for coluna in range(0, 3):
matriz[linha][coluna] = (int(input(f'Número [{linha}][{coluna}]: ')))
for linha in range(0, 3):
for coluna in range(0, 3):
print(f'[{matriz[linha][coluna]:^5}]',end='')
prin... | none | 1 | 3.65849 | 4 | |
download pdfs from url inside a pdf/download_pdf_link.py | zeserrado-marques/Basic-stuff | 1 | 6629519 | <gh_stars>1-10
import requests
url = 'https://link.springer.com/content/pdf/10.1007%2F978-3-030-25943-3.pdf'
myfile = requests.get(url)
open('books_springer/test.pdf', 'wb').write(myfile.content)
| import requests
url = 'https://link.springer.com/content/pdf/10.1007%2F978-3-030-25943-3.pdf'
myfile = requests.get(url)
open('books_springer/test.pdf', 'wb').write(myfile.content) | none | 1 | 2.476255 | 2 | |
trainer/trainer.py | esp32wrangler/Self-Driving-Car | 1 | 6629520 | from keras.layers import Dense, GlobalAveragePooling2D, Reshape, Dropout, Conv2D, Activation
from keras.models import Model
import numpy as np
import cv2
from keras.preprocessing.image import ImageDataGenerator
from keras.applications.mobilenet import preprocess_input
from keras.layers import Input, Lambda
impor... | from keras.layers import Dense, GlobalAveragePooling2D, Reshape, Dropout, Conv2D, Activation
from keras.models import Model
import numpy as np
import cv2
from keras.preprocessing.image import ImageDataGenerator
from keras.applications.mobilenet import preprocess_input
from keras.layers import Input, Lambda
impor... | en | 0.852986 | # I couldn't get the freeze_graph.py script working, so I took this approach to generate the pb file from # https://stackoverflow.com/questions/45466020/how-to-export-keras-h5-to-tensorflow-pb Freezes the state of a session into a pruned computation graph.
Creates a new computation graph where variable nodes are... | 2.804895 | 3 |
plug/spider_views.py | zx273983653/vulscan | 582 | 6629521 | #coding=utf-8
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
#导入公共函数库
from appscan.function import *
#导入数据库模型
from plug.models import spider,spider_conf
#爬虫首页
def index(request):
#获取爬虫结果
tables = spider.objects.all()
#获取爬虫表单配置
form_conf = {}... | #coding=utf-8
from django.shortcuts import render
from django.http import HttpResponse
from django.conf import settings
#导入公共函数库
from appscan.function import *
#导入数据库模型
from plug.models import spider,spider_conf
#爬虫首页
def index(request):
#获取爬虫结果
tables = spider.objects.all()
#获取爬虫表单配置
form_conf = {}... | zh | 0.799106 | #coding=utf-8 #导入公共函数库 #导入数据库模型 #爬虫首页 #获取爬虫结果 #获取爬虫表单配置 #渲染poc列表 #爬虫表单处理 #搜索关键词 #搜索引擎命令 #搜索页数 #爱站权重 #是否去重 #是否去重 #获取扫描的POC #保存爬虫表单参数配置 #汇总搜索关键词参数 #定义爬虫进度 #page_sousuo = 100 #转化为整数百分比 #time.sleep(1) # 调试显示进度效果 #下面开始执行搜索操作 #print "run_spider++++++++",word,i,quanzhong_vaule,chongfu_check,vul_id,"" #pass 结束后返回1,避免报错,结束 可以刷新... | 2.043933 | 2 |
ML/WhatsApp/analysis.py | saneravi/ML_Stuff | 209 | 6629522 | #!/usr/bin/env python
"""Exploratory analysis of a whatsapp chat conversation."""
import datetime
import os
import re
# core modules
from collections import Counter
import matplotlib.pyplot as plt
# 3rd party modules (you might have to install them via pip)
import pandas as pd
def main(path):
"""Analyze a what... | #!/usr/bin/env python
"""Exploratory analysis of a whatsapp chat conversation."""
import datetime
import os
import re
# core modules
from collections import Counter
import matplotlib.pyplot as plt
# 3rd party modules (you might have to install them via pip)
import pandas as pd
def main(path):
"""Analyze a what... | en | 0.526718 | #!/usr/bin/env python Exploratory analysis of a whatsapp chat conversation. # core modules # 3rd party modules (you might have to install them via pip) Analyze a whatsapp chat file. A WhatsApp message object. Parse a WhatsApp chat file into a dataframe. Take on string which contains many messages and return list of mes... | 3.275261 | 3 |
cloudkeeper_os/imagemanager.py | FranceGrilles/cloudkeeper-os | 0 | 6629523 | <gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2017-2018 CNRS and University of Strasbourg
#
# 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.... | # -*- coding: utf-8 -*-
# Copyright 2017-2018 CNRS and University of Strasbourg
#
# 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... | en | 0.779793 | # -*- coding: utf-8 -*- # Copyright 2017-2018 CNRS and University of Strasbourg # # 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 ... | 1.935989 | 2 |
exercicios/exercicio103.py | NicoCassio/cursoemvideo-python | 0 | 6629524 | <reponame>NicoCassio/cursoemvideo-python
def ficha(nome='<desconhecido>', gols=0):
"""
-> Mostra o rendimento do jogador
:param nome: nome do jogador
:param gols: quantidade de gols do jogador
"""
print(f'{nome:<20}{f"{gols} gols":>10}')
# Programa principal
print('-' * 30)
n = str(input('Nome:... | def ficha(nome='<desconhecido>', gols=0):
"""
-> Mostra o rendimento do jogador
:param nome: nome do jogador
:param gols: quantidade de gols do jogador
"""
print(f'{nome:<20}{f"{gols} gols":>10}')
# Programa principal
print('-' * 30)
n = str(input('Nome: '))
g = str(input('Gols: '))
g = int(g) ... | pt | 0.978845 | -> Mostra o rendimento do jogador :param nome: nome do jogador :param gols: quantidade de gols do jogador # Programa principal | 3.785573 | 4 |
sparse/coo/umath.py | nimroha/sparse | 0 | 6629525 | from itertools import product
import numpy as np
import scipy.sparse
import numba
from ..utils import isscalar, PositinalArgumentPartial, _zero_of_dtype
from ..compatibility import range, zip, zip_longest
def elemwise(func, *args, **kwargs):
"""
Apply a function to any number of arguments.
Parameters
... | from itertools import product
import numpy as np
import scipy.sparse
import numba
from ..utils import isscalar, PositinalArgumentPartial, _zero_of_dtype
from ..compatibility import range, zip, zip_longest
def elemwise(func, *args, **kwargs):
"""
Apply a function to any number of arguments.
Parameters
... | en | 0.678978 | Apply a function to any number of arguments. Parameters ---------- func : Callable The function to apply. Must support broadcasting. args : tuple, optional The arguments to the function. Can be :obj:`SparseArray` objects or :obj:`scipy.sparse.spmatrix` objects. kwargs : dict... | 3.004773 | 3 |
src/sales/__init__.py | TechiStack/SalesProject | 0 | 6629526 | default_app_config = 'sales.apps.SalesConfig'
| default_app_config = 'sales.apps.SalesConfig'
| none | 1 | 1.09936 | 1 | |
scripts/resnet_sd/eval_model_c10.py | jielyugt/calibration | 91 | 6629527 | # Load in model weights and evaluate its goodness (ECE, MCE, error) also saves logits
import numpy as np
import collections
import pickle
from resnet_sd import resnet_sd_model
from sklearn.model_selection import train_test_split
from keras.models import Model
from keras.optimizers import SGD
from keras.datasets impor... | # Load in model weights and evaluate its goodness (ECE, MCE, error) also saves logits
import numpy as np
import collections
import pickle
from resnet_sd import resnet_sd_model
from sklearn.model_selection import train_test_split
from keras.models import Model
from keras.optimizers import SGD
from keras.datasets impor... | en | 0.853697 | # Load in model weights and evaluate its goodness (ECE, MCE, error) also saves logits # Imports to get "utility" package # Per channel mean and std normalization # Per channel mean # constants # data # Data splitting (get additional 5k validation set) # Sklearn to split # random_state = seed # Mean per channel # 1-hot ... | 2.623236 | 3 |
wmdadict/migrations/0018_auto_20170830_2143.py | antmont/wmda-stuff | 1 | 6629528 | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-30 11:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wmdadict', '0017_auto_20170830_1920'),
]... | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-30 11:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wmdadict', '0017_auto_20170830_1920'),
]
operation... | en | 0.712553 | # -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-08-30 11:43 | 1.526342 | 2 |
__init__.py | vais-ral/SliceOPy | 0 | 6629529 | <gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 14:52:29 2018
@author: lhe39759
"""
from .DataSlice import DataSlice
from .NetSlice import NetSlice | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 15 14:52:29 2018
@author: lhe39759
"""
from .DataSlice import DataSlice
from .NetSlice import NetSlice | en | 0.817018 | # -*- coding: utf-8 -*- Created on Wed Aug 15 14:52:29 2018 @author: lhe39759 | 0.911863 | 1 |
chroma-manager/tests/integration/shared_storage_configuration/test_firewall_access.py | GarimaVishvakarma/intel-chroma | 0 | 6629530 | <filename>chroma-manager/tests/integration/shared_storage_configuration/test_firewall_access.py<gh_stars>0
from testconfig import config
from django.utils.unittest import skipIf
from tests.utils.remote_firewall_control import RemoteFirewallControl
from tests.integration.core.chroma_integration_testcase import ChromaIn... | <filename>chroma-manager/tests/integration/shared_storage_configuration/test_firewall_access.py<gh_stars>0
from testconfig import config
from django.utils.unittest import skipIf
from tests.utils.remote_firewall_control import RemoteFirewallControl
from tests.integration.core.chroma_integration_testcase import ChromaIn... | en | 0.866497 | Test that the manager has the required selinux setting and firewall access rules installed # TODO: refactor reset_cluster/reset_chroma_manager_db so that previous # state can be cleaned up without initializing the DB # then we can do a before/after firewall state comparison where # before and after are before chroma-co... | 1.967995 | 2 |
registration/urls.py | chris-huynh/via1-registration-website | 0 | 6629531 | from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^login/$', auth_views.login, na... | from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from django.views.generic import TemplateView
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^login/$', auth_views.login, na... | none | 1 | 1.874965 | 2 | |
cfgov/v1/signals.py | thephillipsequation/cfgov-refresh | 4 | 6629532 | <filename>cfgov/v1/signals.py<gh_stars>1-10
from datetime import timedelta
from django.core.cache import caches
from django.utils import timezone
from wagtail.core.signals import page_published
def new_phi(user, expiration_days=90, locked_days=1):
now = timezone.now()
locked_until = now + timedelta(days=loc... | <filename>cfgov/v1/signals.py<gh_stars>1-10
from datetime import timedelta
from django.core.cache import caches
from django.utils import timezone
from wagtail.core.signals import page_published
def new_phi(user, expiration_days=90, locked_days=1):
now = timezone.now()
locked_until = now + timedelta(days=loc... | en | 0.980255 | # If a superuser was created, don't expire its password. # If a regular user was just created, force a new password to be # set right away by expiring the password and unlocking it. | 2.078817 | 2 |
OneDriveUploader/config.py | SimeoneVilardo/OneDriveUploader | 1 | 6629533 | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = 'e2767e53-fc10-405d-9f95-b7ab04fd2f13')
urls = dict(redirect = 'http://localhost:8081',
discovery = 'https://api.office.com/discovery/',
au... | from os.path import join, dirname
from dotenv import load_dotenv, find_dotenv
dotenv_path = join(dirname(__file__), '.env')
load_dotenv(find_dotenv())
client = dict(id = 'e2767e53-fc10-405d-9f95-b7ab04fd2f13')
urls = dict(redirect = 'http://localhost:8081',
discovery = 'https://api.office.com/discovery/',
au... | none | 1 | 2.121132 | 2 | |
Demo/pdist/rcslib.py | deadsnakes/python2.4 | 0 | 6629534 | """RCS interface module.
Defines the class RCS, which represents a directory with rcs version
files and (possibly) corresponding work files.
"""
import fnmatch
import os
import regsub
import string
import tempfile
class RCS:
"""RCS interface class (local filesystem version).
An instance of this class re... | """RCS interface module.
Defines the class RCS, which represents a directory with rcs version
files and (possibly) corresponding work files.
"""
import fnmatch
import os
import regsub
import string
import tempfile
class RCS:
"""RCS interface class (local filesystem version).
An instance of this class re... | en | 0.84275 | RCS interface module. Defines the class RCS, which represents a directory with rcs version files and (possibly) corresponding work files. RCS interface class (local filesystem version). An instance of this class represents a directory with rcs version files and (possible) corresponding work files. Method... | 2.78817 | 3 |
tests/sentry/utils/test_linksign.py | AlexWayfer/sentry | 4 | 6629535 | <filename>tests/sentry/utils/test_linksign.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.test.client import RequestFactory
from sentry.testutils import TestCase
from sentry.utils import linksign
class LinkSignTestCase(TestCase):
def test_link_signing(self):
rf = RequestF... | <filename>tests/sentry/utils/test_linksign.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.test.client import RequestFactory
from sentry.testutils import TestCase
from sentry.utils import linksign
class LinkSignTestCase(TestCase):
def test_link_signing(self):
rf = RequestF... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.208433 | 2 |
svm-classifier.py | ManuelFrieder/FHNW_SentimentAnalysis | 0 | 6629536 | import pandas
import preprocessing as pp
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import svm
from sklearn.pipeline import Pipeline
# define language (de/fr/en) or "" for any
language = ""
preprocessing = pp.PreProcessData(language)
# file paths
corpusFile = '/path/to/trainingData.csv'... | import pandas
import preprocessing as pp
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn import svm
from sklearn.pipeline import Pipeline
# define language (de/fr/en) or "" for any
language = ""
preprocessing = pp.PreProcessData(language)
# file paths
corpusFile = '/path/to/trainingData.csv'... | en | 0.788325 | # define language (de/fr/en) or "" for any # file paths # read files =>check encoding and delimiter! # language filter #Generating the training and testing vectors # training # classify | 3.336659 | 3 |
src/electionguardtest/ballot_factory.py | erikschlegel/electionguard-python | 0 | 6629537 | <reponame>erikschlegel/electionguard-python<gh_stars>0
import os
from jsons import KEY_TRANSFORMER_SNAKECASE, loads
from random import Random
from typing import cast, TypeVar, Callable, List, Tuple
from hypothesis.strategies import (
composite,
booleans,
text,
uuids,
SearchStrategy,
)
from electio... | import os
from jsons import KEY_TRANSFORMER_SNAKECASE, loads
from random import Random
from typing import cast, TypeVar, Callable, List, Tuple
from hypothesis.strategies import (
composite,
booleans,
text,
uuids,
SearchStrategy,
)
from electionguard.ballot import (
PlaintextBallot,
Plainte... | en | 0.865317 | Get a randomly filled contest for the given description that may be undervoted and may include explicitly false votes. Since this is only used for testing, the random number generator (`random`) must be provided to make this function deterministic. # the caller may force a true value # Possibly... | 2.644909 | 3 |
examples/estimator/classifier/LinearSVC/ruby/basics.py | mathewdgardner/sklearn-porter | 1 | 6629538 | # -*- coding: utf-8 -*-
from sklearn import svm
from sklearn.datasets import load_iris
from sklearn_porter import Porter
iris_data = load_iris()
X = iris_data.data
y = iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)
porter = Porter(clf, language='ruby')
output = porter.export()
print(outpu... | # -*- coding: utf-8 -*-
from sklearn import svm
from sklearn.datasets import load_iris
from sklearn_porter import Porter
iris_data = load_iris()
X = iris_data.data
y = iris_data.target
clf = svm.LinearSVC(C=1., random_state=0)
clf.fit(X, y)
porter = Porter(clf, language='ruby')
output = porter.export()
print(outpu... | en | 0.510151 | # -*- coding: utf-8 -*- class LinearSVC def initialize (coefficients, intercepts) @coefficients = coefficients @intercepts = intercepts end def predict (features) classVal = -1.0/0.0 classIdx = -1 for i in 0 ... @intercepts.length prob = 0 for j in 0 ... @coefficients[i].length ... | 2.362404 | 2 |
modules/tests/inv/warehouse_search.py | sungkomp/sambro | 1 | 6629539 | <reponame>sungkomp/sambro
# -*- coding: utf-8 -*-
""" Sahana Eden Warehouse Search Module Automated Tests
@copyright: 2011-2016 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentati... | # -*- coding: utf-8 -*-
""" Sahana Eden Warehouse Search Module Automated Tests
@copyright: 2011-2016 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Softwa... | en | 0.733034 | # -*- coding: utf-8 -*- Sahana Eden Warehouse Search Module Automated Tests
@copyright: 2011-2016 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), t... | 1.790652 | 2 |
root/scripts/setup/01_0_run_job.py | DragonCrafted87/docker-alpine-speedtest-mqtt-publisher | 0 | 6629540 | <reponame>DragonCrafted87/docker-alpine-speedtest-mqtt-publisher
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from datetime import datetime
from json import dumps as dump_to_json
from math import ceil as ceiling
# System Imports
from os import getenv
from pathlib import PurePath
from statistics import fmean as mean
fro... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from datetime import datetime
from json import dumps as dump_to_json
from math import ceil as ceiling
# System Imports
from os import getenv
from pathlib import PurePath
from statistics import fmean as mean
from statistics import median
from time import sleep
from time impor... | en | 0.707773 | #!/usr/bin/python3 # -*- coding: utf-8 -*- # System Imports # Local Imports # 3rd Party | 2.301734 | 2 |
tests/sentry/tasks/test_store.py | vperron/sentry | 0 | 6629541 | <reponame>vperron/sentry<filename>tests/sentry/tasks/test_store.py
from __future__ import absolute_import
import mock
from sentry.plugins import Plugin2
from sentry.tasks.store import preprocess_event
from sentry.testutils import PluginTestCase
class BasicPreprocessorPlugin(Plugin2):
def get_event_preprocessors... | from __future__ import absolute_import
import mock
from sentry.plugins import Plugin2
from sentry.tasks.store import preprocess_event
from sentry.testutils import PluginTestCase
class BasicPreprocessorPlugin(Plugin2):
def get_event_preprocessors(self):
def remove_extra(data):
del data['extra... | none | 1 | 2.142446 | 2 | |
recsys/classifiers/binning.py | krasch/smart-assistants | 9 | 6629542 | <gh_stars>1-10
# -*- coding: UTF-8 -*-
"""
This module contains functions for dealing with temporal bins in the TemporalClassifier.
"""
import numpy
def initialize_bins(start, end, width):
"""
Generate a list of interval borders.
@param start: The left border of the first interval.
@param end: The le... | # -*- coding: UTF-8 -*-
"""
This module contains functions for dealing with temporal bins in the TemporalClassifier.
"""
import numpy
def initialize_bins(start, end, width):
"""
Generate a list of interval borders.
@param start: The left border of the first interval.
@param end: The left border of th... | en | 0.562541 | # -*- coding: UTF-8 -*- This module contains functions for dealing with temporal bins in the TemporalClassifier. Generate a list of interval borders. @param start: The left border of the first interval. @param end: The left border of the last interval. @param width: The width of each interval. @return: ... | 3.202703 | 3 |
tensorflow_datasets/image_classification/imagenet_r.py | Erik-Tran/datasets | 1 | 6629543 | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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 appl... | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# 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 appl... | en | 0.795372 | # coding=utf-8 # Copyright 2020 The TensorFlow Datasets Authors. # # 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 appl... | 1.603301 | 2 |
rowboat/models/migrations/__init__.py | zeromomentum121/speedboat | 16 | 6629544 | import operator
import time
from functools import reduce
from playhouse.migrate import PostgresqlMigrator, migrate
from rowboat import ENV
from rowboat.sql import database, init_db
COLUMN_EXISTS_SQL = '''
SELECT 1
FROM information_schema.columns
WHERE table_name=%s and column_name=%s;
'''
GET_NULLABLE_SQL = '''
SEL... | import operator
import time
from functools import reduce
from playhouse.migrate import PostgresqlMigrator, migrate
from rowboat import ENV
from rowboat.sql import database, init_db
COLUMN_EXISTS_SQL = '''
SELECT 1
FROM information_schema.columns
WHERE table_name=%s and column_name=%s;
'''
GET_NULLABLE_SQL = '''
SEL... | en | 0.354408 | SELECT 1 FROM information_schema.columns WHERE table_name=%s and column_name=%s; SELECT is_nullable FROM information_schema.columns WHERE table_name=%s and column_name=%s; | 2.53905 | 3 |
728.py | RafaelHuang87/Leet-Code-Practice | 0 | 6629545 | """
Solution for Leet Code 728.
"""
class Solution:
def selfDividingNumbers(left, right):
list = []
for i in range(left, right+1):
list.append(i)
j = str(i)
for digit in j:
if digit is "0" or i % int(digit) is not 0:
list.remo... | """
Solution for Leet Code 728.
"""
class Solution:
def selfDividingNumbers(left, right):
list = []
for i in range(left, right+1):
list.append(i)
j = str(i)
for digit in j:
if digit is "0" or i % int(digit) is not 0:
list.remo... | en | 0.307168 | Solution for Leet Code 728. | 3.479384 | 3 |
pyftdi/tests/backend/consts.py | marcjordan2112/pyftdi | 345 | 6629546 | <reponame>marcjordan2112/pyftdi
"""Constant importer from existing modules."""
# Copyright (c) 2020-2021, <NAME> <<EMAIL>>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#pylint: disable-msg=missing-docstring
#pylint: disable-msg=invalid-name
#pylint: disable-msg=too-many-instance-attributes
from e... | """Constant importer from existing modules."""
# Copyright (c) 2020-2021, <NAME> <<EMAIL>>
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#pylint: disable-msg=missing-docstring
#pylint: disable-msg=invalid-name
#pylint: disable-msg=too-many-instance-attributes
from enum import Enum
from importlib i... | en | 0.609107 | Constant importer from existing modules. # Copyright (c) 2020-2021, <NAME> <<EMAIL>> # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause #pylint: disable-msg=missing-docstring #pylint: disable-msg=invalid-name #pylint: disable-msg=too-many-instance-attributes Expose useful constants defined in PyUSB and al... | 2.148753 | 2 |
uvicore/auth/models/group.py | uvicore/framework | 11 | 6629547 | <filename>uvicore/auth/models/group.py
from __future__ import annotations
import uvicore
from uvicore.typing import Optional, List
from uvicore.auth.models.role import Role
from uvicore.support.dumper import dd, dump
from uvicore.orm import Model, ModelMetaclass, Field, BelongsToMany
from uvicore.auth.database.tables i... | <filename>uvicore/auth/models/group.py
from __future__ import annotations
import uvicore
from uvicore.typing import Optional, List
from uvicore.auth.models.role import Role
from uvicore.support.dumper import dd, dump
from uvicore.orm import Model, ModelMetaclass, Field, BelongsToMany
from uvicore.auth.database.tables i... | en | 0.468856 | Auth Group Model # key: str = Field('key', # primary=True, # description='Group Primary Key', # ) # Many-To-Many via group_roles pivot table | 2.34738 | 2 |
idler.py | zignig/cqparts_bucket | 10 | 6629548 | <filename>idler.py
import cadquery as cq
import cqparts
from cadquery import Solid
from cqparts.params import *
from cqparts.display import render_props, display
from cqparts.constraint import Fixed, Coincident
from cqparts.constraint import Mate
from cqparts.utils.geometry import CoordSystem
from cqparts_bearings.bal... | <filename>idler.py
import cadquery as cq
import cqparts
from cadquery import Solid
from cqparts.params import *
from cqparts.display import render_props, display
from cqparts.constraint import Fixed, Coincident
from cqparts.constraint import Mate
from cqparts.utils.geometry import CoordSystem
from cqparts_bearings.bal... | none | 1 | 2.42015 | 2 | |
test/mac/gyptest-app-error.py | Jet-Streaming/gyp | 0 | 6629549 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that invalid strings files cause the build to fail.
"""
import TestCmd
import TestGyp
import sys
if sys.platf... | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that invalid strings files cause the build to fail.
"""
import TestCmd
import TestGyp
import sys
if sys.platf... | en | 0.831238 | #!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Verifies that invalid strings files cause the build to fail. # Python2 has no "nonlocal" keyword. # Ninja pipes stderr of subprocesses to stdo... | 2.285208 | 2 |
src/sentry/utils/distutils/commands/build_js_sdk_registry.py | detouched/sentry | 4 | 6629550 | # NOTE: This is run external to sentry as well as part of the setup
# process. Thus we do not want to import non stdlib things here.
from __future__ import absolute_import
import os
import sys
import json
from distutils import log
import sentry
JS_SDK_REGISTRY_URL = 'https://release-registry.services.sentry.io/pack... | # NOTE: This is run external to sentry as well as part of the setup
# process. Thus we do not want to import non stdlib things here.
from __future__ import absolute_import
import os
import sys
import json
from distutils import log
import sentry
JS_SDK_REGISTRY_URL = 'https://release-registry.services.sentry.io/pack... | en | 0.967024 | # NOTE: This is run external to sentry as well as part of the setup # process. Thus we do not want to import non stdlib things here. # We cannot leverage six here, so we need to vendor # bits that we need. # NOQA | 1.93818 | 2 |