partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | SequenceGenerationVDJ.gen_rnd_prod_CDR3 | Generate a productive CDR3 seq from a Monte Carlo draw of the model.
Parameters
----------
conserved_J_residues : str, optional
Conserved amino acid residues defining the CDR3 on the J side (normally
F, V, and/or W)
Returns
-------
ntseq : str
... | olga/sequence_generation.py | def gen_rnd_prod_CDR3(self, conserved_J_residues = 'FVW'):
"""Generate a productive CDR3 seq from a Monte Carlo draw of the model.
Parameters
----------
conserved_J_residues : str, optional
Conserved amino acid residues defining the CDR3 on the J side (normally
F... | def gen_rnd_prod_CDR3(self, conserved_J_residues = 'FVW'):
"""Generate a productive CDR3 seq from a Monte Carlo draw of the model.
Parameters
----------
conserved_J_residues : str, optional
Conserved amino acid residues defining the CDR3 on the J side (normally
F... | [
"Generate",
"a",
"productive",
"CDR3",
"seq",
"from",
"a",
"Monte",
"Carlo",
"draw",
"of",
"the",
"model",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/sequence_generation.py#L187-L243 | [
"def",
"gen_rnd_prod_CDR3",
"(",
"self",
",",
"conserved_J_residues",
"=",
"'FVW'",
")",
":",
"coding_pass",
"=",
"False",
"while",
"~",
"coding_pass",
":",
"recomb_events",
"=",
"self",
".",
"choose_random_recomb_events",
"(",
")",
"V_seq",
"=",
"self",
".",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | SequenceGenerationVDJ.choose_random_recomb_events | Sample the genomic model for VDJ recombination events.
Returns
-------
recomb_events : dict
Dictionary of the VDJ recombination events. These are
integers determining gene choice, deletions, and number of insertions.
Example
--------
>>> sequence... | olga/sequence_generation.py | def choose_random_recomb_events(self):
"""Sample the genomic model for VDJ recombination events.
Returns
-------
recomb_events : dict
Dictionary of the VDJ recombination events. These are
integers determining gene choice, deletions, and number of insertions.
... | def choose_random_recomb_events(self):
"""Sample the genomic model for VDJ recombination events.
Returns
-------
recomb_events : dict
Dictionary of the VDJ recombination events. These are
integers determining gene choice, deletions, and number of insertions.
... | [
"Sample",
"the",
"genomic",
"model",
"for",
"VDJ",
"recombination",
"events",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/sequence_generation.py#L245-L283 | [
"def",
"choose_random_recomb_events",
"(",
"self",
")",
":",
"recomb_events",
"=",
"{",
"}",
"recomb_events",
"[",
"'V'",
"]",
"=",
"self",
".",
"CPV",
".",
"searchsorted",
"(",
"np",
".",
"random",
".",
"random",
"(",
")",
")",
"#For 2D arrays make sure to ... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | SequenceGenerationVJ.gen_rnd_prod_CDR3 | Generate a productive CDR3 seq from a Monte Carlo draw of the model.
Parameters
----------
conserved_J_residues : str, optional
Conserved amino acid residues defining the CDR3 on the J side (normally
F, V, and/or W)
Returns
-------
ntseq : str
... | olga/sequence_generation.py | def gen_rnd_prod_CDR3(self, conserved_J_residues = 'FVW'):
"""Generate a productive CDR3 seq from a Monte Carlo draw of the model.
Parameters
----------
conserved_J_residues : str, optional
Conserved amino acid residues defining the CDR3 on the J side (normally
F... | def gen_rnd_prod_CDR3(self, conserved_J_residues = 'FVW'):
"""Generate a productive CDR3 seq from a Monte Carlo draw of the model.
Parameters
----------
conserved_J_residues : str, optional
Conserved amino acid residues defining the CDR3 on the J side (normally
F... | [
"Generate",
"a",
"productive",
"CDR3",
"seq",
"from",
"a",
"Monte",
"Carlo",
"draw",
"of",
"the",
"model",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/sequence_generation.py#L368-L422 | [
"def",
"gen_rnd_prod_CDR3",
"(",
"self",
",",
"conserved_J_residues",
"=",
"'FVW'",
")",
":",
"coding_pass",
"=",
"False",
"while",
"~",
"coding_pass",
":",
"recomb_events",
"=",
"self",
".",
"choose_random_recomb_events",
"(",
")",
"V_seq",
"=",
"self",
".",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | SequenceGenerationVJ.choose_random_recomb_events | Sample the genomic model for VDJ recombination events.
Returns
-------
recomb_events : dict
Dictionary of the VDJ recombination events. These are
integers determining gene choice, deletions, and number of insertions.
Example
--------
>>> sequence... | olga/sequence_generation.py | def choose_random_recomb_events(self):
"""Sample the genomic model for VDJ recombination events.
Returns
-------
recomb_events : dict
Dictionary of the VDJ recombination events. These are
integers determining gene choice, deletions, and number of insertions.
... | def choose_random_recomb_events(self):
"""Sample the genomic model for VDJ recombination events.
Returns
-------
recomb_events : dict
Dictionary of the VDJ recombination events. These are
integers determining gene choice, deletions, and number of insertions.
... | [
"Sample",
"the",
"genomic",
"model",
"for",
"VDJ",
"recombination",
"events",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/sequence_generation.py#L424-L454 | [
"def",
"choose_random_recomb_events",
"(",
"self",
")",
":",
"recomb_events",
"=",
"{",
"}",
"#For 2D arrays make sure to take advantage of a mod expansion to find indicies",
"VJ_choice",
"=",
"self",
".",
"CPVJ",
".",
"searchsorted",
"(",
"np",
".",
"random",
".",
"ran... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | BaseRateBackend.update_rates | Creates or updates rates for a source | djmoney_rates/backends.py | def update_rates(self):
"""
Creates or updates rates for a source
"""
source, created = RateSource.objects.get_or_create(name=self.get_source_name())
source.base_currency = self.get_base_currency()
source.save()
for currency, value in six.iteritems(self.get_rates... | def update_rates(self):
"""
Creates or updates rates for a source
"""
source, created = RateSource.objects.get_or_create(name=self.get_source_name())
source.base_currency = self.get_base_currency()
source.save()
for currency, value in six.iteritems(self.get_rates... | [
"Creates",
"or",
"updates",
"rates",
"for",
"a",
"source"
] | evonove/django-money-rates | python | https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/backends.py#L52-L67 | [
"def",
"update_rates",
"(",
"self",
")",
":",
"source",
",",
"created",
"=",
"RateSource",
".",
"objects",
".",
"get_or_create",
"(",
"name",
"=",
"self",
".",
"get_source_name",
"(",
")",
")",
"source",
".",
"base_currency",
"=",
"self",
".",
"get_base_cu... | ac1f7636b9a38d3e153eb833019342c4d88634c2 |
train | sample_gtf | Generate samples from the generalized graph trend filtering distribution via a modified Swendsen-Wang slice sampling algorithm.
Options for likelihood: gaussian, binomial, poisson. Options for prior: laplace, doublepareto. | pygfl/bayes.py | def sample_gtf(data, D, k, likelihood='gaussian', prior='laplace',
lambda_hyperparams=None, lam_walk_stdev=0.01, lam0=1.,
dp_hyperparameter=None, w_hyperparameters=None,
iterations=7000, burn=2000, thin=10,
robus... | def sample_gtf(data, D, k, likelihood='gaussian', prior='laplace',
lambda_hyperparams=None, lam_walk_stdev=0.01, lam0=1.,
dp_hyperparameter=None, w_hyperparameters=None,
iterations=7000, burn=2000, thin=10,
robus... | [
"Generate",
"samples",
"from",
"the",
"generalized",
"graph",
"trend",
"filtering",
"distribution",
"via",
"a",
"modified",
"Swendsen",
"-",
"Wang",
"slice",
"sampling",
"algorithm",
".",
"Options",
"for",
"likelihood",
":",
"gaussian",
"binomial",
"poisson",
".",... | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/bayes.py#L138-L274 | [
"def",
"sample_gtf",
"(",
"data",
",",
"D",
",",
"k",
",",
"likelihood",
"=",
"'gaussian'",
",",
"prior",
"=",
"'laplace'",
",",
"lambda_hyperparams",
"=",
"None",
",",
"lam_walk_stdev",
"=",
"0.01",
",",
"lam0",
"=",
"1.",
",",
"dp_hyperparameter",
"=",
... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | GenerationProbability.compute_regex_CDR3_template_pgen | Compute Pgen for all seqs consistent with regular expression regex_seq.
Computes Pgen for a (limited vocabulary) regular expression of CDR3
amino acid sequences, conditioned on the V genes/alleles indicated in
V_usage_mask_in and the J genes/alleles in J_usage_mask_in. Please note
... | olga/generation_probability.py | def compute_regex_CDR3_template_pgen(self, regex_seq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True, raise_overload_warning = True):
"""Compute Pgen for all seqs consistent with regular expression regex_seq.
Computes Pgen for a (limited vocabulary) regular expression of CDR3... | def compute_regex_CDR3_template_pgen(self, regex_seq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True, raise_overload_warning = True):
"""Compute Pgen for all seqs consistent with regular expression regex_seq.
Computes Pgen for a (limited vocabulary) regular expression of CDR3... | [
"Compute",
"Pgen",
"for",
"all",
"seqs",
"consistent",
"with",
"regular",
"expression",
"regex_seq",
".",
"Computes",
"Pgen",
"for",
"a",
"(",
"limited",
"vocabulary",
")",
"regular",
"expression",
"of",
"CDR3",
"amino",
"acid",
"sequences",
"conditioned",
"on",... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L156-L213 | [
"def",
"compute_regex_CDR3_template_pgen",
"(",
"self",
",",
"regex_seq",
",",
"V_usage_mask_in",
"=",
"None",
",",
"J_usage_mask_in",
"=",
"None",
",",
"print_warnings",
"=",
"True",
",",
"raise_overload_warning",
"=",
"True",
")",
":",
"V_usage_mask",
",",
"J_us... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.compute_aa_CDR3_pgen | Compute Pgen for the amino acid sequence CDR3_seq.
Conditioned on the V genes/alleles indicated in V_usage_mask_in and the
J genes/alleles in J_usage_mask_in. (Examples are TCRB sequences/model)
Parameters
----------
CDR3_seq : str
CDR3 sequence composed of... | olga/generation_probability.py | def compute_aa_CDR3_pgen(self, CDR3_seq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True):
"""Compute Pgen for the amino acid sequence CDR3_seq.
Conditioned on the V genes/alleles indicated in V_usage_mask_in and the
J genes/alleles in J_usage_mask_in. (Examples are T... | def compute_aa_CDR3_pgen(self, CDR3_seq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True):
"""Compute Pgen for the amino acid sequence CDR3_seq.
Conditioned on the V genes/alleles indicated in V_usage_mask_in and the
J genes/alleles in J_usage_mask_in. (Examples are T... | [
"Compute",
"Pgen",
"for",
"the",
"amino",
"acid",
"sequence",
"CDR3_seq",
".",
"Conditioned",
"on",
"the",
"V",
"genes",
"/",
"alleles",
"indicated",
"in",
"V_usage_mask_in",
"and",
"the",
"J",
"genes",
"/",
"alleles",
"in",
"J_usage_mask_in",
".",
"(",
"Exa... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L216-L264 | [
"def",
"compute_aa_CDR3_pgen",
"(",
"self",
",",
"CDR3_seq",
",",
"V_usage_mask_in",
"=",
"None",
",",
"J_usage_mask_in",
"=",
"None",
",",
"print_warnings",
"=",
"True",
")",
":",
"if",
"len",
"(",
"CDR3_seq",
")",
"==",
"0",
":",
"return",
"0",
"for",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.compute_hamming_dist_1_pgen | Compute Pgen of all seqs hamming dist 1 (in amino acids) from CDR3_seq.
Please note that this function will list out all the
sequences that are hamming distance 1 from the base sequence and then
calculate the Pgen of each sequence in succession. THIS CAN BE SLOW
as it computes Pg... | olga/generation_probability.py | def compute_hamming_dist_1_pgen(self, CDR3_seq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True):
"""Compute Pgen of all seqs hamming dist 1 (in amino acids) from CDR3_seq.
Please note that this function will list out all the
sequences that are hamming distance 1 from... | def compute_hamming_dist_1_pgen(self, CDR3_seq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True):
"""Compute Pgen of all seqs hamming dist 1 (in amino acids) from CDR3_seq.
Please note that this function will list out all the
sequences that are hamming distance 1 from... | [
"Compute",
"Pgen",
"of",
"all",
"seqs",
"hamming",
"dist",
"1",
"(",
"in",
"amino",
"acids",
")",
"from",
"CDR3_seq",
".",
"Please",
"note",
"that",
"this",
"function",
"will",
"list",
"out",
"all",
"the",
"sequences",
"that",
"are",
"hamming",
"distance",... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L266-L316 | [
"def",
"compute_hamming_dist_1_pgen",
"(",
"self",
",",
"CDR3_seq",
",",
"V_usage_mask_in",
"=",
"None",
",",
"J_usage_mask_in",
"=",
"None",
",",
"print_warnings",
"=",
"True",
")",
":",
"#make sure that the symbol X is defined as the fully undetermined amino acid:",
"#X ~... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.compute_nt_CDR3_pgen | Compute Pgen for the inframe nucleotide sequence CDR3_ntseq.
Conditioned on the V genes/alleles indicated in V_usage_mask_in and the
J genes/alleles in J_usage_mask_in. (Examples are TCRB sequences/model)
Parameters
----------
CDR3_ntseq : str
Inframe nucle... | olga/generation_probability.py | def compute_nt_CDR3_pgen(self, CDR3_ntseq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True):
"""Compute Pgen for the inframe nucleotide sequence CDR3_ntseq.
Conditioned on the V genes/alleles indicated in V_usage_mask_in and the
J genes/alleles in J_usage_mask_in. (Ex... | def compute_nt_CDR3_pgen(self, CDR3_ntseq, V_usage_mask_in = None, J_usage_mask_in = None, print_warnings = True):
"""Compute Pgen for the inframe nucleotide sequence CDR3_ntseq.
Conditioned on the V genes/alleles indicated in V_usage_mask_in and the
J genes/alleles in J_usage_mask_in. (Ex... | [
"Compute",
"Pgen",
"for",
"the",
"inframe",
"nucleotide",
"sequence",
"CDR3_ntseq",
".",
"Conditioned",
"on",
"the",
"V",
"genes",
"/",
"alleles",
"indicated",
"in",
"V_usage_mask_in",
"and",
"the",
"J",
"genes",
"/",
"alleles",
"in",
"J_usage_mask_in",
".",
"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L318-L368 | [
"def",
"compute_nt_CDR3_pgen",
"(",
"self",
",",
"CDR3_ntseq",
",",
"V_usage_mask_in",
"=",
"None",
",",
"J_usage_mask_in",
"=",
"None",
",",
"print_warnings",
"=",
"True",
")",
":",
"if",
"not",
"len",
"(",
"CDR3_ntseq",
")",
"%",
"3",
"==",
"0",
":",
"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.format_usage_masks | Format raw usage masks into lists of indices.
Usage masks allows the Pgen computation to be conditioned on the V and J
gene/allele identities. The inputted masks are lists of strings, or a
single string, of the names of the genes or alleles to be conditioned on.
The default mask ... | olga/generation_probability.py | def format_usage_masks(self, V_usage_mask_in, J_usage_mask_in, print_warnings = True):
"""Format raw usage masks into lists of indices.
Usage masks allows the Pgen computation to be conditioned on the V and J
gene/allele identities. The inputted masks are lists of strings, or a
si... | def format_usage_masks(self, V_usage_mask_in, J_usage_mask_in, print_warnings = True):
"""Format raw usage masks into lists of indices.
Usage masks allows the Pgen computation to be conditioned on the V and J
gene/allele identities. The inputted masks are lists of strings, or a
si... | [
"Format",
"raw",
"usage",
"masks",
"into",
"lists",
"of",
"indices",
".",
"Usage",
"masks",
"allows",
"the",
"Pgen",
"computation",
"to",
"be",
"conditioned",
"on",
"the",
"V",
"and",
"J",
"gene",
"/",
"allele",
"identities",
".",
"The",
"inputted",
"masks... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L377-L470 | [
"def",
"format_usage_masks",
"(",
"self",
",",
"V_usage_mask_in",
",",
"J_usage_mask_in",
",",
"print_warnings",
"=",
"True",
")",
":",
"#Format the V usage mask",
"if",
"V_usage_mask_in",
"is",
"None",
":",
"#Default case, use all productive V genes with non-zero probability... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.list_seqs_from_regex | List sequences that match regular expression template.
This function parses a limited regular expression vocabulary, and
lists all the sequences consistent with the regular expression. Supported
regex syntax: [] and {}. Cannot have two {} in a row. Note we can't use
Kline star (*... | olga/generation_probability.py | def list_seqs_from_regex(self, regex_seq, print_warnings = True, raise_overload_warning = True):
"""List sequences that match regular expression template.
This function parses a limited regular expression vocabulary, and
lists all the sequences consistent with the regular expression. Suppo... | def list_seqs_from_regex(self, regex_seq, print_warnings = True, raise_overload_warning = True):
"""List sequences that match regular expression template.
This function parses a limited regular expression vocabulary, and
lists all the sequences consistent with the regular expression. Suppo... | [
"List",
"sequences",
"that",
"match",
"regular",
"expression",
"template",
".",
"This",
"function",
"parses",
"a",
"limited",
"regular",
"expression",
"vocabulary",
"and",
"lists",
"all",
"the",
"sequences",
"consistent",
"with",
"the",
"regular",
"expression",
".... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L472-L601 | [
"def",
"list_seqs_from_regex",
"(",
"self",
",",
"regex_seq",
",",
"print_warnings",
"=",
"True",
",",
"raise_overload_warning",
"=",
"True",
")",
":",
"aa_symbols",
"=",
"''",
".",
"join",
"(",
"self",
".",
"codons_dict",
")",
"default_max_reps",
"=",
"40",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.max_nt_to_aa_alignment_left | Find maximum match between CDR3_seq and ntseq from the left.
This function returns the length of the maximum length nucleotide
subsequence of ntseq contiguous from the left (or 5' end) that is
consistent with the 'amino acid' sequence CDR3_seq.
Parameters
----------
... | olga/generation_probability.py | def max_nt_to_aa_alignment_left(self, CDR3_seq, ntseq):
"""Find maximum match between CDR3_seq and ntseq from the left.
This function returns the length of the maximum length nucleotide
subsequence of ntseq contiguous from the left (or 5' end) that is
consistent with the 'amino... | def max_nt_to_aa_alignment_left(self, CDR3_seq, ntseq):
"""Find maximum match between CDR3_seq and ntseq from the left.
This function returns the length of the maximum length nucleotide
subsequence of ntseq contiguous from the left (or 5' end) that is
consistent with the 'amino... | [
"Find",
"maximum",
"match",
"between",
"CDR3_seq",
"and",
"ntseq",
"from",
"the",
"left",
".",
"This",
"function",
"returns",
"the",
"length",
"of",
"the",
"maximum",
"length",
"nucleotide",
"subsequence",
"of",
"ntseq",
"contiguous",
"from",
"the",
"left",
"(... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L604-L652 | [
"def",
"max_nt_to_aa_alignment_left",
"(",
"self",
",",
"CDR3_seq",
",",
"ntseq",
")",
":",
"max_alignment",
"=",
"0",
"if",
"len",
"(",
"ntseq",
")",
"==",
"0",
":",
"return",
"0",
"aa_aligned",
"=",
"True",
"while",
"aa_aligned",
":",
"if",
"ntseq",
"[... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbability.max_nt_to_aa_alignment_right | Find maximum match between CDR3_seq and ntseq from the right.
This function returns the length of the maximum length nucleotide
subsequence of ntseq contiguous from the right (or 3' end) that is
consistent with the 'amino acid' sequence CDR3_seq
Parameters
----------
... | olga/generation_probability.py | def max_nt_to_aa_alignment_right(self, CDR3_seq, ntseq):
"""Find maximum match between CDR3_seq and ntseq from the right.
This function returns the length of the maximum length nucleotide
subsequence of ntseq contiguous from the right (or 3' end) that is
consistent with the 'amino ... | def max_nt_to_aa_alignment_right(self, CDR3_seq, ntseq):
"""Find maximum match between CDR3_seq and ntseq from the right.
This function returns the length of the maximum length nucleotide
subsequence of ntseq contiguous from the right (or 3' end) that is
consistent with the 'amino ... | [
"Find",
"maximum",
"match",
"between",
"CDR3_seq",
"and",
"ntseq",
"from",
"the",
"right",
".",
"This",
"function",
"returns",
"the",
"length",
"of",
"the",
"maximum",
"length",
"nucleotide",
"subsequence",
"of",
"ntseq",
"contiguous",
"from",
"the",
"right",
... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L654-L703 | [
"def",
"max_nt_to_aa_alignment_right",
"(",
"self",
",",
"CDR3_seq",
",",
"ntseq",
")",
":",
"r_CDR3_seq",
"=",
"CDR3_seq",
"[",
":",
":",
"-",
"1",
"]",
"#reverse CDR3_seq",
"r_ntseq",
"=",
"ntseq",
"[",
":",
":",
"-",
"1",
"]",
"#reverse ntseq",
"max_ali... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVDJ.compute_CDR3_pgen | Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VDJ model.
Conditioned on the already formatted V genes/alleles indicated in
V_usage_mask and the J genes/alleles in J_usage_mask.
(Examples are TCRB sequences/model)
Parameters
----------
CDR3_seq : st... | olga/generation_probability.py | def compute_CDR3_pgen(self, CDR3_seq, V_usage_mask, J_usage_mask):
"""Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VDJ model.
Conditioned on the already formatted V genes/alleles indicated in
V_usage_mask and the J genes/alleles in J_usage_mask.
(Examples are TCRB seq... | def compute_CDR3_pgen(self, CDR3_seq, V_usage_mask, J_usage_mask):
"""Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VDJ model.
Conditioned on the already formatted V genes/alleles indicated in
V_usage_mask and the J genes/alleles in J_usage_mask.
(Examples are TCRB seq... | [
"Compute",
"Pgen",
"for",
"CDR3",
"amino",
"acid",
"sequence",
"CDR3_seq",
"from",
"VDJ",
"model",
".",
"Conditioned",
"on",
"the",
"already",
"formatted",
"V",
"genes",
"/",
"alleles",
"indicated",
"in",
"V_usage_mask",
"and",
"the",
"J",
"genes",
"/",
"all... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L849-L904 | [
"def",
"compute_CDR3_pgen",
"(",
"self",
",",
"CDR3_seq",
",",
"V_usage_mask",
",",
"J_usage_mask",
")",
":",
"#Genomic V alignment/matching (contribution from P(V, delV)), return Pi_V",
"Pi_V",
",",
"max_V_align",
"=",
"self",
".",
"compute_Pi_V",
"(",
"CDR3_seq",
",",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVDJ.compute_Pi_V | Compute Pi_V.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V)*P(delV|V). This corresponds to V_{x_1}.
For clarity in parsing the algorithm implementation, we include which
instance attributes are used in the method as 'param... | olga/generation_probability.py | def compute_Pi_V(self, CDR3_seq, V_usage_mask):
"""Compute Pi_V.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V)*P(delV|V). This corresponds to V_{x_1}.
For clarity in parsing the algorithm implementation, we include which
... | def compute_Pi_V(self, CDR3_seq, V_usage_mask):
"""Compute Pi_V.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V)*P(delV|V). This corresponds to V_{x_1}.
For clarity in parsing the algorithm implementation, we include which
... | [
"Compute",
"Pi_V",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"V",
"genomic",
"contributions",
"P",
"(",
"V",
")",
"*",
"P",
"(",
"delV|V",
")",
".",
"This",
"corresponds",
"to",
"V_",
"{",... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L907-L968 | [
"def",
"compute_Pi_V",
"(",
"self",
",",
"CDR3_seq",
",",
"V_usage_mask",
")",
":",
"#Note, the cutV_genomic_CDR3_segs INCLUDE the palindromic insertions and thus are max_palindrome nts longer than the template.",
"#furthermore, the genomic sequence should be pruned to start at the conserved C... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVDJ.compute_Pi_L | Compute Pi_L.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V)*P(delV|V), and the VD (N1) insertions,
first_nt_bias_insVD(m_1)PinsVD(\ell_{VD})\prod_{i=2}^{\ell_{VD}}Rvd(m_i|m_{i-1}).
This corresponds to V_{x_1}{M^{x_1}}_{x_2}.
... | olga/generation_probability.py | def compute_Pi_L(self, CDR3_seq, Pi_V, max_V_align):
"""Compute Pi_L.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V)*P(delV|V), and the VD (N1) insertions,
first_nt_bias_insVD(m_1)PinsVD(\ell_{VD})\prod_{i=2}^{\ell_{VD}}Rvd(m_i|m_{i-1... | def compute_Pi_L(self, CDR3_seq, Pi_V, max_V_align):
"""Compute Pi_L.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V)*P(delV|V), and the VD (N1) insertions,
first_nt_bias_insVD(m_1)PinsVD(\ell_{VD})\prod_{i=2}^{\ell_{VD}}Rvd(m_i|m_{i-1... | [
"Compute",
"Pi_L",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"V",
"genomic",
"contributions",
"P",
"(",
"V",
")",
"*",
"P",
"(",
"delV|V",
")",
"and",
"the",
"VD",
"(",
"N1",
")",
"inser... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L971-L1088 | [
"def",
"compute_Pi_L",
"(",
"self",
",",
"CDR3_seq",
",",
"Pi_V",
",",
"max_V_align",
")",
":",
"#max_insertions = 30 #len(PinsVD) - 1 should zeropad the last few spots",
"max_insertions",
"=",
"len",
"(",
"self",
".",
"PinsVD",
")",
"-",
"1",
"Pi_L",
"=",
"np",
"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVDJ.compute_Pi_J_given_D | Compute Pi_J conditioned on D.
This function returns the Pi array from the model factors of the D and J
genomic contributions, P(D, J)*P(delJ|J) = P(D|J)P(J)P(delJ|J). This
corresponds to J(D)^{x_4}.
For clarity in parsing the algorithm implementation, we include which
... | olga/generation_probability.py | def compute_Pi_J_given_D(self, CDR3_seq, J_usage_mask):
"""Compute Pi_J conditioned on D.
This function returns the Pi array from the model factors of the D and J
genomic contributions, P(D, J)*P(delJ|J) = P(D|J)P(J)P(delJ|J). This
corresponds to J(D)^{x_4}.
For c... | def compute_Pi_J_given_D(self, CDR3_seq, J_usage_mask):
"""Compute Pi_J conditioned on D.
This function returns the Pi array from the model factors of the D and J
genomic contributions, P(D, J)*P(delJ|J) = P(D|J)P(J)P(delJ|J). This
corresponds to J(D)^{x_4}.
For c... | [
"Compute",
"Pi_J",
"conditioned",
"on",
"D",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"D",
"and",
"J",
"genomic",
"contributions",
"P",
"(",
"D",
"J",
")",
"*",
"P",
"(",
"delJ|J",
")",
... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1091-L1159 | [
"def",
"compute_Pi_J_given_D",
"(",
"self",
",",
"CDR3_seq",
",",
"J_usage_mask",
")",
":",
"#Note, the cutJ_genomic_CDR3_segs INCLUDE the palindromic insertions and thus are max_palindrome nts longer than the template.",
"#furthermore, the genomic sequence should be pruned to start at a conse... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVDJ.compute_Pi_JinsDJ_given_D | Compute Pi_JinsDJ conditioned on D.
This function returns the Pi array from the model factors of the J genomic
contributions, P(D,J)*P(delJ|J), and the DJ (N2) insertions,
first_nt_bias_insDJ(n_1)PinsDJ(\ell_{DJ})\prod_{i=2}^{\ell_{DJ}}Rdj(n_i|n_{i-1})
conditioned on D identity. T... | olga/generation_probability.py | def compute_Pi_JinsDJ_given_D(self, CDR3_seq, Pi_J_given_D, max_J_align):
"""Compute Pi_JinsDJ conditioned on D.
This function returns the Pi array from the model factors of the J genomic
contributions, P(D,J)*P(delJ|J), and the DJ (N2) insertions,
first_nt_bias_insDJ(n_1)PinsDJ(\e... | def compute_Pi_JinsDJ_given_D(self, CDR3_seq, Pi_J_given_D, max_J_align):
"""Compute Pi_JinsDJ conditioned on D.
This function returns the Pi array from the model factors of the J genomic
contributions, P(D,J)*P(delJ|J), and the DJ (N2) insertions,
first_nt_bias_insDJ(n_1)PinsDJ(\e... | [
"Compute",
"Pi_JinsDJ",
"conditioned",
"on",
"D",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"J",
"genomic",
"contributions",
"P",
"(",
"D",
"J",
")",
"*",
"P",
"(",
"delJ|J",
")",
"and",
"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1162-L1282 | [
"def",
"compute_Pi_JinsDJ_given_D",
"(",
"self",
",",
"CDR3_seq",
",",
"Pi_J_given_D",
",",
"max_J_align",
")",
":",
"#max_insertions = 30 #len(PinsVD) - 1 should zeropad the last few spots",
"max_insertions",
"=",
"len",
"(",
"self",
".",
"PinsDJ",
")",
"-",
"1",
"Pi_J... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVDJ.compute_Pi_R | Compute Pi_R.
This function returns the Pi array from the model factors of the D and J
genomic contributions, P(D, J)*P(delJ|J)P(delDl, delDr |D) and
the DJ (N2) insertions,
first_nt_bias_insDJ(n_1)PinsDJ(\ell_{DJ})\prod_{i=2}^{\ell_{DJ}}Rdj(n_i|n_{i-1}).
This corresponds t... | olga/generation_probability.py | def compute_Pi_R(self, CDR3_seq, Pi_JinsDJ_given_D):
"""Compute Pi_R.
This function returns the Pi array from the model factors of the D and J
genomic contributions, P(D, J)*P(delJ|J)P(delDl, delDr |D) and
the DJ (N2) insertions,
first_nt_bias_insDJ(n_1)PinsDJ(\ell_{DJ})\pr... | def compute_Pi_R(self, CDR3_seq, Pi_JinsDJ_given_D):
"""Compute Pi_R.
This function returns the Pi array from the model factors of the D and J
genomic contributions, P(D, J)*P(delJ|J)P(delDl, delDr |D) and
the DJ (N2) insertions,
first_nt_bias_insDJ(n_1)PinsDJ(\ell_{DJ})\pr... | [
"Compute",
"Pi_R",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"D",
"and",
"J",
"genomic",
"contributions",
"P",
"(",
"D",
"J",
")",
"*",
"P",
"(",
"delJ|J",
")",
"P",
"(",
"delDl",
"delDr... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1285-L1521 | [
"def",
"compute_Pi_R",
"(",
"self",
",",
"CDR3_seq",
",",
"Pi_JinsDJ_given_D",
")",
":",
"#Need to consider all D alignments from all possible positions and right deletions.",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
"2",
",",
"'... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVJ.compute_CDR3_pgen | Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VJ model.
Conditioned on the already formatted V genes/alleles indicated in
V_usage_mask and the J genes/alleles in J_usage_mask.
Parameters
----------
CDR3_seq : str
CDR3 sequence composed of 'amino... | olga/generation_probability.py | def compute_CDR3_pgen(self, CDR3_seq, V_usage_mask, J_usage_mask):
"""Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VJ model.
Conditioned on the already formatted V genes/alleles indicated in
V_usage_mask and the J genes/alleles in J_usage_mask.
Parameters
... | def compute_CDR3_pgen(self, CDR3_seq, V_usage_mask, J_usage_mask):
"""Compute Pgen for CDR3 'amino acid' sequence CDR3_seq from VJ model.
Conditioned on the already formatted V genes/alleles indicated in
V_usage_mask and the J genes/alleles in J_usage_mask.
Parameters
... | [
"Compute",
"Pgen",
"for",
"CDR3",
"amino",
"acid",
"sequence",
"CDR3_seq",
"from",
"VJ",
"model",
".",
"Conditioned",
"on",
"the",
"already",
"formatted",
"V",
"genes",
"/",
"alleles",
"indicated",
"in",
"V_usage_mask",
"and",
"the",
"J",
"genes",
"/",
"alle... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1630-L1676 | [
"def",
"compute_CDR3_pgen",
"(",
"self",
",",
"CDR3_seq",
",",
"V_usage_mask",
",",
"J_usage_mask",
")",
":",
"#Genomic J alignment/matching (contribution from P(delJ | J)), return Pi_J and reduced J_usage_mask",
"Pi_J",
",",
"r_J_usage_mask",
"=",
"self",
".",
"compute_Pi_J",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVJ.compute_Pi_V_given_J | Compute Pi_V conditioned on J.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V, J)*P(delV|V). This corresponds to V(J)_{x_1}.
For clarity in parsing the algorithm implementation, we include which
instance attributes are used i... | olga/generation_probability.py | def compute_Pi_V_given_J(self, CDR3_seq, V_usage_mask, J_usage_mask):
"""Compute Pi_V conditioned on J.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V, J)*P(delV|V). This corresponds to V(J)_{x_1}.
For clarity in parsing the a... | def compute_Pi_V_given_J(self, CDR3_seq, V_usage_mask, J_usage_mask):
"""Compute Pi_V conditioned on J.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V, J)*P(delV|V). This corresponds to V(J)_{x_1}.
For clarity in parsing the a... | [
"Compute",
"Pi_V",
"conditioned",
"on",
"J",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"V",
"genomic",
"contributions",
"P",
"(",
"V",
"J",
")",
"*",
"P",
"(",
"delV|V",
")",
".",
"This",
... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1679-L1746 | [
"def",
"compute_Pi_V_given_J",
"(",
"self",
",",
"CDR3_seq",
",",
"V_usage_mask",
",",
"J_usage_mask",
")",
":",
"#Note, the cutV_genomic_CDR3_segs INCLUDE the palindromic insertions and thus are max_palindrome nts longer than the template.",
"#furthermore, the genomic sequence should be p... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVJ.compute_Pi_V_insVJ_given_J | Compute Pi_V_insVJ conditioned on J.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V, J)*P(delV|V), and the VJ (N) insertions,
first_nt_bias_insVJ(m_1)PinsVJ(\ell_{VJ})\prod_{i=2}^{\ell_{VJ}}Rvj(m_i|m_{i-1}).
This corresponds to V(J)_{... | olga/generation_probability.py | def compute_Pi_V_insVJ_given_J(self, CDR3_seq, Pi_V_given_J, max_V_align):
"""Compute Pi_V_insVJ conditioned on J.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V, J)*P(delV|V), and the VJ (N) insertions,
first_nt_bias_insVJ(m_1)PinsVJ(... | def compute_Pi_V_insVJ_given_J(self, CDR3_seq, Pi_V_given_J, max_V_align):
"""Compute Pi_V_insVJ conditioned on J.
This function returns the Pi array from the model factors of the V genomic
contributions, P(V, J)*P(delV|V), and the VJ (N) insertions,
first_nt_bias_insVJ(m_1)PinsVJ(... | [
"Compute",
"Pi_V_insVJ",
"conditioned",
"on",
"J",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"V",
"genomic",
"contributions",
"P",
"(",
"V",
"J",
")",
"*",
"P",
"(",
"delV|V",
")",
"and",
... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1749-L1868 | [
"def",
"compute_Pi_V_insVJ_given_J",
"(",
"self",
",",
"CDR3_seq",
",",
"Pi_V_given_J",
",",
"max_V_align",
")",
":",
"#max_insertions = 30 #len(PinsVJ) - 1 should zeropad the last few spots",
"max_insertions",
"=",
"len",
"(",
"self",
".",
"PinsVJ",
")",
"-",
"1",
"Pi_... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerationProbabilityVJ.compute_Pi_J | Compute Pi_J.
This function returns the Pi array from the model factors of the J genomic
contributions, P(delJ|J). This corresponds to J(D)^{x_4}.
For clarity in parsing the algorithm implementation, we include which
instance attributes are used in the method as 'paramete... | olga/generation_probability.py | def compute_Pi_J(self, CDR3_seq, J_usage_mask):
"""Compute Pi_J.
This function returns the Pi array from the model factors of the J genomic
contributions, P(delJ|J). This corresponds to J(D)^{x_4}.
For clarity in parsing the algorithm implementation, we include which
... | def compute_Pi_J(self, CDR3_seq, J_usage_mask):
"""Compute Pi_J.
This function returns the Pi array from the model factors of the J genomic
contributions, P(delJ|J). This corresponds to J(D)^{x_4}.
For clarity in parsing the algorithm implementation, we include which
... | [
"Compute",
"Pi_J",
".",
"This",
"function",
"returns",
"the",
"Pi",
"array",
"from",
"the",
"model",
"factors",
"of",
"the",
"J",
"genomic",
"contributions",
"P",
"(",
"delJ|J",
")",
".",
"This",
"corresponds",
"to",
"J",
"(",
"D",
")",
"^",
"{",
"x_4"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/generation_probability.py#L1871-L1935 | [
"def",
"compute_Pi_J",
"(",
"self",
",",
"CDR3_seq",
",",
"J_usage_mask",
")",
":",
"#Note, the cutJ_genomic_CDR3_segs INCLUDE the palindromic insertions and thus are max_palindrome nts longer than the template.",
"#furthermore, the genomic sequence should be pruned to start at a conserved reg... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | TrendFilteringSolver.solve | Solves the GFL for a fixed value of lambda. | pygfl/trendfiltering.py | def solve(self, lam):
'''Solves the GFL for a fixed value of lambda.'''
s = weighted_graphtf(self.nnodes, self.y, self.weights, lam,
self.Dk.shape[0], self.Dk.shape[1], self.Dk.nnz,
self.Dk.row.astype('int32'), self.Dk.col.astype('int32'), self.D... | def solve(self, lam):
'''Solves the GFL for a fixed value of lambda.'''
s = weighted_graphtf(self.nnodes, self.y, self.weights, lam,
self.Dk.shape[0], self.Dk.shape[1], self.Dk.nnz,
self.Dk.row.astype('int32'), self.Dk.col.astype('int32'), self.D... | [
"Solves",
"the",
"GFL",
"for",
"a",
"fixed",
"value",
"of",
"lambda",
"."
] | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trendfiltering.py#L73-L81 | [
"def",
"solve",
"(",
"self",
",",
"lam",
")",
":",
"s",
"=",
"weighted_graphtf",
"(",
"self",
".",
"nnodes",
",",
"self",
".",
"y",
",",
"self",
".",
"weights",
",",
"lam",
",",
"self",
".",
"Dk",
".",
"shape",
"[",
"0",
"]",
",",
"self",
".",
... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | TrendFilteringSolver.solution_path | Follows the solution path to find the best lambda value. | pygfl/trendfiltering.py | def solution_path(self, min_lambda, max_lambda, lambda_bins, verbose=0):
'''Follows the solution path to find the best lambda value.'''
self.u = np.zeros(self.Dk.shape[0], dtype='double')
lambda_grid = np.exp(np.linspace(np.log(max_lambda), np.log(min_lambda), lambda_bins))
aic_trace = n... | def solution_path(self, min_lambda, max_lambda, lambda_bins, verbose=0):
'''Follows the solution path to find the best lambda value.'''
self.u = np.zeros(self.Dk.shape[0], dtype='double')
lambda_grid = np.exp(np.linspace(np.log(max_lambda), np.log(min_lambda), lambda_bins))
aic_trace = n... | [
"Follows",
"the",
"solution",
"path",
"to",
"find",
"the",
"best",
"lambda",
"value",
"."
] | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trendfiltering.py#L83-L157 | [
"def",
"solution_path",
"(",
"self",
",",
"min_lambda",
",",
"max_lambda",
",",
"lambda_bins",
",",
"verbose",
"=",
"0",
")",
":",
"self",
".",
"u",
"=",
"np",
".",
"zeros",
"(",
"self",
".",
"Dk",
".",
"shape",
"[",
"0",
"]",
",",
"dtype",
"=",
... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | LogitTrendFilteringSolver.solve | Solves the GFL for a fixed value of lambda. | pygfl/trendfiltering.py | def solve(self, lam):
'''Solves the GFL for a fixed value of lambda.'''
s = weighted_graphtf_logit(self.nnodes, self.trials, self.successes, lam,
self.Dk.shape[0], self.Dk.shape[1], self.Dk.nnz,
self.Dk.row.astype('int32'), self.Dk.col.as... | def solve(self, lam):
'''Solves the GFL for a fixed value of lambda.'''
s = weighted_graphtf_logit(self.nnodes, self.trials, self.successes, lam,
self.Dk.shape[0], self.Dk.shape[1], self.Dk.nnz,
self.Dk.row.astype('int32'), self.Dk.col.as... | [
"Solves",
"the",
"GFL",
"for",
"a",
"fixed",
"value",
"of",
"lambda",
"."
] | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trendfiltering.py#L169-L177 | [
"def",
"solve",
"(",
"self",
",",
"lam",
")",
":",
"s",
"=",
"weighted_graphtf_logit",
"(",
"self",
".",
"nnodes",
",",
"self",
".",
"trials",
",",
"self",
".",
"successes",
",",
"lam",
",",
"self",
".",
"Dk",
".",
"shape",
"[",
"0",
"]",
",",
"s... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | PoissonTrendFilteringSolver.solve | Solves the GFL for a fixed value of lambda. | pygfl/trendfiltering.py | def solve(self, lam):
'''Solves the GFL for a fixed value of lambda.'''
s = weighted_graphtf_poisson(self.nnodes, self.obs, lam,
self.Dk.shape[0], self.Dk.shape[1], self.Dk.nnz,
self.Dk.row.astype('int32'), self.Dk.col.astype('int32'), se... | def solve(self, lam):
'''Solves the GFL for a fixed value of lambda.'''
s = weighted_graphtf_poisson(self.nnodes, self.obs, lam,
self.Dk.shape[0], self.Dk.shape[1], self.Dk.nnz,
self.Dk.row.astype('int32'), self.Dk.col.astype('int32'), se... | [
"Solves",
"the",
"GFL",
"for",
"a",
"fixed",
"value",
"of",
"lambda",
"."
] | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trendfiltering.py#L188-L196 | [
"def",
"solve",
"(",
"self",
",",
"lam",
")",
":",
"s",
"=",
"weighted_graphtf_poisson",
"(",
"self",
".",
"nnodes",
",",
"self",
".",
"obs",
",",
"lam",
",",
"self",
".",
"Dk",
".",
"shape",
"[",
"0",
"]",
",",
"self",
".",
"Dk",
".",
"shape",
... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | PreprocessedParameters.make_V_and_J_mask_mapping | Constructs the V and J mask mapping dictionaries.
Parameters
----------
genV : list
List of genomic V information.
genJ : list
List of genomic J information. | olga/preprocess_generative_model_and_data.py | def make_V_and_J_mask_mapping(self, genV, genJ):
"""Constructs the V and J mask mapping dictionaries.
Parameters
----------
genV : list
List of genomic V information.
genJ : list
List of genomic J information.
"""
... | def make_V_and_J_mask_mapping(self, genV, genJ):
"""Constructs the V and J mask mapping dictionaries.
Parameters
----------
genV : list
List of genomic V information.
genJ : list
List of genomic J information.
"""
... | [
"Constructs",
"the",
"V",
"and",
"J",
"mask",
"mapping",
"dictionaries",
".",
"Parameters",
"----------",
"genV",
":",
"list",
"List",
"of",
"genomic",
"V",
"information",
".",
"genJ",
":",
"list",
"List",
"of",
"genomic",
"J",
"information",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L157-L195 | [
"def",
"make_V_and_J_mask_mapping",
"(",
"self",
",",
"genV",
",",
"genJ",
")",
":",
"#construct mapping between allele/gene names and index for custom V_usage_masks",
"V_allele_names",
"=",
"[",
"V",
"[",
"0",
"]",
"for",
"V",
"in",
"genV",
"]",
"V_mask_mapping",
"="... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVDJ.preprocess_D_segs | Process P(delDl, delDr|D) into Pi arrays.
Sets the attributes PD_nt_pos_vec, PD_2nd_nt_pos_per_aa_vec,
min_delDl_given_DdelDr, max_delDl_given_DdelDr, and zeroD_given_D.
Parameters
----------
generative_model : GenerativeModelVDJ
VDJ generative model cl... | olga/preprocess_generative_model_and_data.py | def preprocess_D_segs(self, generative_model, genomic_data):
"""Process P(delDl, delDr|D) into Pi arrays.
Sets the attributes PD_nt_pos_vec, PD_2nd_nt_pos_per_aa_vec,
min_delDl_given_DdelDr, max_delDl_given_DdelDr, and zeroD_given_D.
Parameters
----------
g... | def preprocess_D_segs(self, generative_model, genomic_data):
"""Process P(delDl, delDr|D) into Pi arrays.
Sets the attributes PD_nt_pos_vec, PD_2nd_nt_pos_per_aa_vec,
min_delDl_given_DdelDr, max_delDl_given_DdelDr, and zeroD_given_D.
Parameters
----------
g... | [
"Process",
"P",
"(",
"delDl",
"delDr|D",
")",
"into",
"Pi",
"arrays",
".",
"Sets",
"the",
"attributes",
"PD_nt_pos_vec",
"PD_2nd_nt_pos_per_aa_vec",
"min_delDl_given_DdelDr",
"max_delDl_given_DdelDr",
"and",
"zeroD_given_D",
".",
"Parameters",
"----------",
"generative_mo... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L463-L541 | [
"def",
"preprocess_D_segs",
"(",
"self",
",",
"generative_model",
",",
"genomic_data",
")",
":",
"cutD_genomic_CDR3_segs",
"=",
"genomic_data",
".",
"cutD_genomic_CDR3_segs",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
"2",
",... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVDJ.generate_PJdelJ_nt_pos_vecs | Process P(J)*P(delJ|J) into Pi arrays.
Sets the attributes PJdelJ_nt_pos_vec and PJdelJ_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVDJ
VDJ generative model class containing the model parameters.
genomic_dat... | olga/preprocess_generative_model_and_data.py | def generate_PJdelJ_nt_pos_vecs(self, generative_model, genomic_data):
"""Process P(J)*P(delJ|J) into Pi arrays.
Sets the attributes PJdelJ_nt_pos_vec and PJdelJ_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVDJ
VDJ gener... | def generate_PJdelJ_nt_pos_vecs(self, generative_model, genomic_data):
"""Process P(J)*P(delJ|J) into Pi arrays.
Sets the attributes PJdelJ_nt_pos_vec and PJdelJ_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVDJ
VDJ gener... | [
"Process",
"P",
"(",
"J",
")",
"*",
"P",
"(",
"delJ|J",
")",
"into",
"Pi",
"arrays",
".",
"Sets",
"the",
"attributes",
"PJdelJ_nt_pos_vec",
"and",
"PJdelJ_2nd_nt_pos_per_aa_vec",
".",
"Parameters",
"----------",
"generative_model",
":",
"GenerativeModelVDJ",
"VDJ"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L543-L592 | [
"def",
"generate_PJdelJ_nt_pos_vecs",
"(",
"self",
",",
"generative_model",
",",
"genomic_data",
")",
":",
"cutJ_genomic_CDR3_segs",
"=",
"genomic_data",
".",
"cutJ_genomic_CDR3_segs",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVDJ.generate_VD_junction_transfer_matrices | Compute the transfer matrices for the VD junction.
Sets the attributes Tvd, Svd, Dvd, lTvd, and lDvd. | olga/preprocess_generative_model_and_data.py | def generate_VD_junction_transfer_matrices(self):
"""Compute the transfer matrices for the VD junction.
Sets the attributes Tvd, Svd, Dvd, lTvd, and lDvd.
"""
nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
#Compute Tvd
Tvd ... | def generate_VD_junction_transfer_matrices(self):
"""Compute the transfer matrices for the VD junction.
Sets the attributes Tvd, Svd, Dvd, lTvd, and lDvd.
"""
nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
#Compute Tvd
Tvd ... | [
"Compute",
"the",
"transfer",
"matrices",
"for",
"the",
"VD",
"junction",
".",
"Sets",
"the",
"attributes",
"Tvd",
"Svd",
"Dvd",
"lTvd",
"and",
"lDvd",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L594-L654 | [
"def",
"generate_VD_junction_transfer_matrices",
"(",
"self",
")",
":",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
"2",
",",
"'T'",
":",
"3",
"}",
"#Compute Tvd",
"Tvd",
"=",
"{",
"}",
"for",
"aa",
"in",
"self",
"."... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVDJ.generate_DJ_junction_transfer_matrices | Compute the transfer matrices for the VD junction.
Sets the attributes Tdj, Sdj, Ddj, rTdj, and rDdj. | olga/preprocess_generative_model_and_data.py | def generate_DJ_junction_transfer_matrices(self):
"""Compute the transfer matrices for the VD junction.
Sets the attributes Tdj, Sdj, Ddj, rTdj, and rDdj.
"""
nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
#Compute Tdj
Tdj = {}
for aa... | def generate_DJ_junction_transfer_matrices(self):
"""Compute the transfer matrices for the VD junction.
Sets the attributes Tdj, Sdj, Ddj, rTdj, and rDdj.
"""
nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
#Compute Tdj
Tdj = {}
for aa... | [
"Compute",
"the",
"transfer",
"matrices",
"for",
"the",
"VD",
"junction",
".",
"Sets",
"the",
"attributes",
"Tdj",
"Sdj",
"Ddj",
"rTdj",
"and",
"rDdj",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L656-L713 | [
"def",
"generate_DJ_junction_transfer_matrices",
"(",
"self",
")",
":",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
"2",
",",
"'T'",
":",
"3",
"}",
"#Compute Tdj ",
"Tdj",
"=",
"{",
"}",
"for",
"aa",
"in",
"self",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVJ.generate_PVdelV_nt_pos_vecs | Process P(delV|V) into Pi arrays.
Set the attributes PVdelV_nt_pos_vec and PVdelV_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVJ
VJ generative model class containing the model parameters.
genomic_data : Geno... | olga/preprocess_generative_model_and_data.py | def generate_PVdelV_nt_pos_vecs(self, generative_model, genomic_data):
"""Process P(delV|V) into Pi arrays.
Set the attributes PVdelV_nt_pos_vec and PVdelV_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVJ
VJ generative mo... | def generate_PVdelV_nt_pos_vecs(self, generative_model, genomic_data):
"""Process P(delV|V) into Pi arrays.
Set the attributes PVdelV_nt_pos_vec and PVdelV_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVJ
VJ generative mo... | [
"Process",
"P",
"(",
"delV|V",
")",
"into",
"Pi",
"arrays",
".",
"Set",
"the",
"attributes",
"PVdelV_nt_pos_vec",
"and",
"PVdelV_2nd_nt_pos_per_aa_vec",
".",
"Parameters",
"----------",
"generative_model",
":",
"GenerativeModelVJ",
"VJ",
"generative",
"model",
"class"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L860-L904 | [
"def",
"generate_PVdelV_nt_pos_vecs",
"(",
"self",
",",
"generative_model",
",",
"genomic_data",
")",
":",
"cutV_genomic_CDR3_segs",
"=",
"genomic_data",
".",
"cutV_genomic_CDR3_segs",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVJ.generate_PJdelJ_nt_pos_vecs | Process P(delJ|J) into Pi arrays.
Set the attributes PJdelJ_nt_pos_vec and PJdelJ_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVJ
VJ generative model class containing the model parameters.
genomic_data : Geno... | olga/preprocess_generative_model_and_data.py | def generate_PJdelJ_nt_pos_vecs(self, generative_model, genomic_data):
"""Process P(delJ|J) into Pi arrays.
Set the attributes PJdelJ_nt_pos_vec and PJdelJ_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVJ
VJ generative mo... | def generate_PJdelJ_nt_pos_vecs(self, generative_model, genomic_data):
"""Process P(delJ|J) into Pi arrays.
Set the attributes PJdelJ_nt_pos_vec and PJdelJ_2nd_nt_pos_per_aa_vec.
Parameters
----------
generative_model : GenerativeModelVJ
VJ generative mo... | [
"Process",
"P",
"(",
"delJ|J",
")",
"into",
"Pi",
"arrays",
".",
"Set",
"the",
"attributes",
"PJdelJ_nt_pos_vec",
"and",
"PJdelJ_2nd_nt_pos_per_aa_vec",
".",
"Parameters",
"----------",
"generative_model",
":",
"GenerativeModelVJ",
"VJ",
"generative",
"model",
"class"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L906-L953 | [
"def",
"generate_PJdelJ_nt_pos_vecs",
"(",
"self",
",",
"generative_model",
",",
"genomic_data",
")",
":",
"cutJ_genomic_CDR3_segs",
"=",
"genomic_data",
".",
"cutJ_genomic_CDR3_segs",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | PreprocessedParametersVJ.generate_VJ_junction_transfer_matrices | Compute the transfer matrices for the VJ junction.
Sets the attributes Tvj, Svj, Dvj, lTvj, and lDvj. | olga/preprocess_generative_model_and_data.py | def generate_VJ_junction_transfer_matrices(self):
"""Compute the transfer matrices for the VJ junction.
Sets the attributes Tvj, Svj, Dvj, lTvj, and lDvj.
"""
nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
#Compute Tvj
Tv... | def generate_VJ_junction_transfer_matrices(self):
"""Compute the transfer matrices for the VJ junction.
Sets the attributes Tvj, Svj, Dvj, lTvj, and lDvj.
"""
nt2num = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
#Compute Tvj
Tv... | [
"Compute",
"the",
"transfer",
"matrices",
"for",
"the",
"VJ",
"junction",
".",
"Sets",
"the",
"attributes",
"Tvj",
"Svj",
"Dvj",
"lTvj",
"and",
"lDvj",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/preprocess_generative_model_and_data.py#L956-L1014 | [
"def",
"generate_VJ_junction_transfer_matrices",
"(",
"self",
")",
":",
"nt2num",
"=",
"{",
"'A'",
":",
"0",
",",
"'C'",
":",
"1",
",",
"'G'",
":",
"2",
",",
"'T'",
":",
"3",
"}",
"#Compute Tvj",
"Tvj",
"=",
"{",
"}",
"for",
"aa",
"in",
"self",
"."... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | showDosHeaderData | Prints IMAGE_DOS_HEADER fields. | tools/readpe.py | def showDosHeaderData(peInstance):
""" Prints IMAGE_DOS_HEADER fields. """
dosFields = peInstance.dosHeader.getFields()
print "[+] IMAGE_DOS_HEADER values:\n"
for field in dosFields:
if isinstance(dosFields[field], datatypes.Array):
print "--> %s - Array of length %d" % (field,... | def showDosHeaderData(peInstance):
""" Prints IMAGE_DOS_HEADER fields. """
dosFields = peInstance.dosHeader.getFields()
print "[+] IMAGE_DOS_HEADER values:\n"
for field in dosFields:
if isinstance(dosFields[field], datatypes.Array):
print "--> %s - Array of length %d" % (field,... | [
"Prints",
"IMAGE_DOS_HEADER",
"fields",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L43-L56 | [
"def",
"showDosHeaderData",
"(",
"peInstance",
")",
":",
"dosFields",
"=",
"peInstance",
".",
"dosHeader",
".",
"getFields",
"(",
")",
"print",
"\"[+] IMAGE_DOS_HEADER values:\\n\"",
"for",
"field",
"in",
"dosFields",
":",
"if",
"isinstance",
"(",
"dosFields",
"["... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | showFileHeaderData | Prints IMAGE_FILE_HEADER fields. | tools/readpe.py | def showFileHeaderData(peInstance):
""" Prints IMAGE_FILE_HEADER fields. """
fileHeaderFields = peInstance.ntHeaders.fileHeader.getFields()
print "[+] IMAGE_FILE_HEADER values:\n"
for field in fileHeaderFields:
print "--> %s = 0x%08x" % (field, fileHeaderFields[field].value) | def showFileHeaderData(peInstance):
""" Prints IMAGE_FILE_HEADER fields. """
fileHeaderFields = peInstance.ntHeaders.fileHeader.getFields()
print "[+] IMAGE_FILE_HEADER values:\n"
for field in fileHeaderFields:
print "--> %s = 0x%08x" % (field, fileHeaderFields[field].value) | [
"Prints",
"IMAGE_FILE_HEADER",
"fields",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L64-L70 | [
"def",
"showFileHeaderData",
"(",
"peInstance",
")",
":",
"fileHeaderFields",
"=",
"peInstance",
".",
"ntHeaders",
".",
"fileHeader",
".",
"getFields",
"(",
")",
"print",
"\"[+] IMAGE_FILE_HEADER values:\\n\"",
"for",
"field",
"in",
"fileHeaderFields",
":",
"print",
... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | showOptionalHeaderData | Prints IMAGE_OPTIONAL_HEADER fields. | tools/readpe.py | def showOptionalHeaderData(peInstance):
""" Prints IMAGE_OPTIONAL_HEADER fields. """
print "[+] IMAGE_OPTIONAL_HEADER:\n"
ohFields = peInstance.ntHeaders.optionalHeader.getFields()
for field in ohFields:
if not isinstance(ohFields[field], datadirs.DataDirectory):
print "--> %s ... | def showOptionalHeaderData(peInstance):
""" Prints IMAGE_OPTIONAL_HEADER fields. """
print "[+] IMAGE_OPTIONAL_HEADER:\n"
ohFields = peInstance.ntHeaders.optionalHeader.getFields()
for field in ohFields:
if not isinstance(ohFields[field], datadirs.DataDirectory):
print "--> %s ... | [
"Prints",
"IMAGE_OPTIONAL_HEADER",
"fields",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L72-L79 | [
"def",
"showOptionalHeaderData",
"(",
"peInstance",
")",
":",
"print",
"\"[+] IMAGE_OPTIONAL_HEADER:\\n\"",
"ohFields",
"=",
"peInstance",
".",
"ntHeaders",
".",
"optionalHeader",
".",
"getFields",
"(",
")",
"for",
"field",
"in",
"ohFields",
":",
"if",
"not",
"isi... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | showDataDirectoriesData | Prints the DATA_DIRECTORY fields. | tools/readpe.py | def showDataDirectoriesData(peInstance):
""" Prints the DATA_DIRECTORY fields. """
print "[+] Data directories:\n"
dirs = peInstance.ntHeaders.optionalHeader.dataDirectory
counter = 1
for dir in dirs:
print "[%d] --> Name: %s -- RVA: 0x%08x -- SIZE: 0x%08x" % (counter, dir.name.value, ... | def showDataDirectoriesData(peInstance):
""" Prints the DATA_DIRECTORY fields. """
print "[+] Data directories:\n"
dirs = peInstance.ntHeaders.optionalHeader.dataDirectory
counter = 1
for dir in dirs:
print "[%d] --> Name: %s -- RVA: 0x%08x -- SIZE: 0x%08x" % (counter, dir.name.value, ... | [
"Prints",
"the",
"DATA_DIRECTORY",
"fields",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L81-L89 | [
"def",
"showDataDirectoriesData",
"(",
"peInstance",
")",
":",
"print",
"\"[+] Data directories:\\n\"",
"dirs",
"=",
"peInstance",
".",
"ntHeaders",
".",
"optionalHeader",
".",
"dataDirectory",
"counter",
"=",
"1",
"for",
"dir",
"in",
"dirs",
":",
"print",
"\"[%d]... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | showSectionsHeaders | Prints IMAGE_SECTION_HEADER for every section present in the file. | tools/readpe.py | def showSectionsHeaders(peInstance):
""" Prints IMAGE_SECTION_HEADER for every section present in the file. """
print "[+] Sections information:\n"
print "--> NumberOfSections: %d\n" % peInstance.ntHeaders.fileHeader.numberOfSections.value
for section in peInstance.sectionHeaders:
fields = ... | def showSectionsHeaders(peInstance):
""" Prints IMAGE_SECTION_HEADER for every section present in the file. """
print "[+] Sections information:\n"
print "--> NumberOfSections: %d\n" % peInstance.ntHeaders.fileHeader.numberOfSections.value
for section in peInstance.sectionHeaders:
fields = ... | [
"Prints",
"IMAGE_SECTION_HEADER",
"for",
"every",
"section",
"present",
"in",
"the",
"file",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L91-L104 | [
"def",
"showSectionsHeaders",
"(",
"peInstance",
")",
":",
"print",
"\"[+] Sections information:\\n\"",
"print",
"\"--> NumberOfSections: %d\\n\"",
"%",
"peInstance",
".",
"ntHeaders",
".",
"fileHeader",
".",
"numberOfSections",
".",
"value",
"for",
"section",
"in",
"pe... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | showImports | Shows imports information. | tools/readpe.py | def showImports(peInstance):
""" Shows imports information. """
iidEntries = peInstance.ntHeaders.optionalHeader.dataDirectory[consts.IMPORT_DIRECTORY].info
if iidEntries:
for iidEntry in iidEntries:
fields = iidEntry.getFields()
print "module: %s" % iidEntry.metaData.mo... | def showImports(peInstance):
""" Shows imports information. """
iidEntries = peInstance.ntHeaders.optionalHeader.dataDirectory[consts.IMPORT_DIRECTORY].info
if iidEntries:
for iidEntry in iidEntries:
fields = iidEntry.getFields()
print "module: %s" % iidEntry.metaData.mo... | [
"Shows",
"imports",
"information",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L106-L124 | [
"def",
"showImports",
"(",
"peInstance",
")",
":",
"iidEntries",
"=",
"peInstance",
".",
"ntHeaders",
".",
"optionalHeader",
".",
"dataDirectory",
"[",
"consts",
".",
"IMPORT_DIRECTORY",
"]",
".",
"info",
"if",
"iidEntries",
":",
"for",
"iidEntry",
"in",
"iidE... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | showExports | Show exports information | tools/readpe.py | def showExports(peInstance):
""" Show exports information """
exports = peInstance.ntHeaders.optionalHeader.dataDirectory[consts.EXPORT_DIRECTORY].info
if exports:
exp_fields = exports.getFields()
for field in exp_fields:
print "%s -> %x" % (field, exp_fields[field].value)
... | def showExports(peInstance):
""" Show exports information """
exports = peInstance.ntHeaders.optionalHeader.dataDirectory[consts.EXPORT_DIRECTORY].info
if exports:
exp_fields = exports.getFields()
for field in exp_fields:
print "%s -> %x" % (field, exp_fields[field].value)
... | [
"Show",
"exports",
"information"
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/tools/readpe.py#L126-L140 | [
"def",
"showExports",
"(",
"peInstance",
")",
":",
"exports",
"=",
"peInstance",
".",
"ntHeaders",
".",
"optionalHeader",
".",
"dataDirectory",
"[",
"consts",
".",
"EXPORT_DIRECTORY",
"]",
".",
"info",
"if",
"exports",
":",
"exp_fields",
"=",
"exports",
".",
... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | BaseStructClass.getFields | Returns all the class attributues.
@rtype: dict
@return: A dictionary containing all the class attributes. | pype32/baseclasses.py | def getFields(self):
"""
Returns all the class attributues.
@rtype: dict
@return: A dictionary containing all the class attributes.
"""
d = {}
for i in self._attrsList:
key = i
value = getattr(self, i)
d[key] = value
... | def getFields(self):
"""
Returns all the class attributues.
@rtype: dict
@return: A dictionary containing all the class attributes.
"""
d = {}
for i in self._attrsList:
key = i
value = getattr(self, i)
d[key] = value
... | [
"Returns",
"all",
"the",
"class",
"attributues",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/baseclasses.py#L65-L77 | [
"def",
"getFields",
"(",
"self",
")",
":",
"d",
"=",
"{",
"}",
"for",
"i",
"in",
"self",
".",
"_attrsList",
":",
"key",
"=",
"i",
"value",
"=",
"getattr",
"(",
"self",
",",
"i",
")",
"d",
"[",
"key",
"]",
"=",
"value",
"return",
"d"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | Array.parse | Returns a new L{Array} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: The L{ReadData} object containing the array data.
@type arrayType: int
@param arrayType: The type of L{Array} to be built.
@type arrayLength: int
@param ... | pype32/datatypes.py | def parse(readDataInstance, arrayType, arrayLength):
"""
Returns a new L{Array} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: The L{ReadData} object containing the array data.
@type arrayType: int
@param arrayType: The type of L{... | def parse(readDataInstance, arrayType, arrayLength):
"""
Returns a new L{Array} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: The L{ReadData} object containing the array data.
@type arrayType: int
@param arrayType: The type of L{... | [
"Returns",
"a",
"new",
"L",
"{",
"Array",
"}",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/datatypes.py#L145-L196 | [
"def",
"parse",
"(",
"readDataInstance",
",",
"arrayType",
",",
"arrayLength",
")",
":",
"newArray",
"=",
"Array",
"(",
"arrayType",
")",
"dataLength",
"=",
"len",
"(",
"readDataInstance",
")",
"if",
"arrayType",
"is",
"TYPE_DWORD",
":",
"toRead",
"=",
"arra... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | calc_euler_tour | Calculates an Euler tour over the graph g from vertex start to vertex end.
Assumes start and end are odd-degree vertices and that there are no other odd-degree
vertices. | pygfl/trails.py | def calc_euler_tour(g, start, end):
'''Calculates an Euler tour over the graph g from vertex start to vertex end.
Assumes start and end are odd-degree vertices and that there are no other odd-degree
vertices.'''
even_g = nx.subgraph(g, g.nodes()).copy()
if end in even_g.neighbors(start):
# I... | def calc_euler_tour(g, start, end):
'''Calculates an Euler tour over the graph g from vertex start to vertex end.
Assumes start and end are odd-degree vertices and that there are no other odd-degree
vertices.'''
even_g = nx.subgraph(g, g.nodes()).copy()
if end in even_g.neighbors(start):
# I... | [
"Calculates",
"an",
"Euler",
"tour",
"over",
"the",
"graph",
"g",
"from",
"vertex",
"start",
"to",
"vertex",
"end",
".",
"Assumes",
"start",
"and",
"end",
"are",
"odd",
"-",
"degree",
"vertices",
"and",
"that",
"there",
"are",
"no",
"other",
"odd",
"-",
... | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trails.py#L50-L79 | [
"def",
"calc_euler_tour",
"(",
"g",
",",
"start",
",",
"end",
")",
":",
"even_g",
"=",
"nx",
".",
"subgraph",
"(",
"g",
",",
"g",
".",
"nodes",
"(",
")",
")",
".",
"copy",
"(",
")",
"if",
"end",
"in",
"even_g",
".",
"neighbors",
"(",
"start",
"... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | greedy_trails | Greedily select trails by making the longest you can until the end | pygfl/trails.py | def greedy_trails(subg, odds, verbose):
'''Greedily select trails by making the longest you can until the end'''
if verbose:
print('\tCreating edge map')
edges = defaultdict(list)
for x,y in subg.edges():
edges[x].append(y)
edges[y].append(x)
if verbose:
print('\tS... | def greedy_trails(subg, odds, verbose):
'''Greedily select trails by making the longest you can until the end'''
if verbose:
print('\tCreating edge map')
edges = defaultdict(list)
for x,y in subg.edges():
edges[x].append(y)
edges[y].append(x)
if verbose:
print('\tS... | [
"Greedily",
"select",
"trails",
"by",
"making",
"the",
"longest",
"you",
"can",
"until",
"the",
"end"
] | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trails.py#L307-L338 | [
"def",
"greedy_trails",
"(",
"subg",
",",
"odds",
",",
"verbose",
")",
":",
"if",
"verbose",
":",
"print",
"(",
"'\\tCreating edge map'",
")",
"edges",
"=",
"defaultdict",
"(",
"list",
")",
"for",
"x",
",",
"y",
"in",
"subg",
".",
"edges",
"(",
")",
... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | decompose_graph | Decompose a graph into a set of non-overlapping trails. | pygfl/trails.py | def decompose_graph(g, heuristic='tour', max_odds=20, verbose=0):
'''Decompose a graph into a set of non-overlapping trails.'''
# Get the connected subgraphs
subgraphs = [nx.subgraph(g, x).copy() for x in nx.connected_components(g)]
chains = []
num_subgraphs = len(subgraphs)
step = 0
while ... | def decompose_graph(g, heuristic='tour', max_odds=20, verbose=0):
'''Decompose a graph into a set of non-overlapping trails.'''
# Get the connected subgraphs
subgraphs = [nx.subgraph(g, x).copy() for x in nx.connected_components(g)]
chains = []
num_subgraphs = len(subgraphs)
step = 0
while ... | [
"Decompose",
"a",
"graph",
"into",
"a",
"set",
"of",
"non",
"-",
"overlapping",
"trails",
"."
] | tansey/gfl | python | https://github.com/tansey/gfl/blob/ae0f078bab57aba9e827ed6162f247ff9dc2aa19/pygfl/trails.py#L341-L414 | [
"def",
"decompose_graph",
"(",
"g",
",",
"heuristic",
"=",
"'tour'",
",",
"max_odds",
"=",
"20",
",",
"verbose",
"=",
"0",
")",
":",
"# Get the connected subgraphs",
"subgraphs",
"=",
"[",
"nx",
".",
"subgraph",
"(",
"g",
",",
"x",
")",
".",
"copy",
"(... | ae0f078bab57aba9e827ed6162f247ff9dc2aa19 |
train | Vector.plus | Add. | csg/geom.py | def plus(self, a):
""" Add. """
return Vector(self.x+a.x, self.y+a.y, self.z+a.z) | def plus(self, a):
""" Add. """
return Vector(self.x+a.x, self.y+a.y, self.z+a.z) | [
"Add",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L50-L52 | [
"def",
"plus",
"(",
"self",
",",
"a",
")",
":",
"return",
"Vector",
"(",
"self",
".",
"x",
"+",
"a",
".",
"x",
",",
"self",
".",
"y",
"+",
"a",
".",
"y",
",",
"self",
".",
"z",
"+",
"a",
".",
"z",
")"
] | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | Vector.minus | Subtract. | csg/geom.py | def minus(self, a):
""" Subtract. """
return Vector(self.x-a.x, self.y-a.y, self.z-a.z) | def minus(self, a):
""" Subtract. """
return Vector(self.x-a.x, self.y-a.y, self.z-a.z) | [
"Subtract",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L57-L59 | [
"def",
"minus",
"(",
"self",
",",
"a",
")",
":",
"return",
"Vector",
"(",
"self",
".",
"x",
"-",
"a",
".",
"x",
",",
"self",
".",
"y",
"-",
"a",
".",
"y",
",",
"self",
".",
"z",
"-",
"a",
".",
"z",
")"
] | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | Vector.times | Multiply. | csg/geom.py | def times(self, a):
""" Multiply. """
return Vector(self.x*a, self.y*a, self.z*a) | def times(self, a):
""" Multiply. """
return Vector(self.x*a, self.y*a, self.z*a) | [
"Multiply",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L64-L66 | [
"def",
"times",
"(",
"self",
",",
"a",
")",
":",
"return",
"Vector",
"(",
"self",
".",
"x",
"*",
"a",
",",
"self",
".",
"y",
"*",
"a",
",",
"self",
".",
"z",
"*",
"a",
")"
] | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | Vector.dividedBy | Divide. | csg/geom.py | def dividedBy(self, a):
""" Divide. """
return Vector(self.x/a, self.y/a, self.z/a) | def dividedBy(self, a):
""" Divide. """
return Vector(self.x/a, self.y/a, self.z/a) | [
"Divide",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L71-L73 | [
"def",
"dividedBy",
"(",
"self",
",",
"a",
")",
":",
"return",
"Vector",
"(",
"self",
".",
"x",
"/",
"a",
",",
"self",
".",
"y",
"/",
"a",
",",
"self",
".",
"z",
"/",
"a",
")"
] | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | Vector.lerp | Lerp. Linear interpolation from self to a | csg/geom.py | def lerp(self, a, t):
""" Lerp. Linear interpolation from self to a"""
return self.plus(a.minus(self).times(t)); | def lerp(self, a, t):
""" Lerp. Linear interpolation from self to a"""
return self.plus(a.minus(self).times(t)); | [
"Lerp",
".",
"Linear",
"interpolation",
"from",
"self",
"to",
"a"
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L85-L87 | [
"def",
"lerp",
"(",
"self",
",",
"a",
",",
"t",
")",
":",
"return",
"self",
".",
"plus",
"(",
"a",
".",
"minus",
"(",
"self",
")",
".",
"times",
"(",
"t",
")",
")"
] | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | Vertex.interpolate | Create a new vertex between this vertex and `other` by linearly
interpolating all properties using a parameter of `t`. Subclasses should
override this to interpolate additional properties. | csg/geom.py | def interpolate(self, other, t):
"""
Create a new vertex between this vertex and `other` by linearly
interpolating all properties using a parameter of `t`. Subclasses should
override this to interpolate additional properties.
"""
return Vertex(self.pos.lerp(other.pos, t),... | def interpolate(self, other, t):
"""
Create a new vertex between this vertex and `other` by linearly
interpolating all properties using a parameter of `t`. Subclasses should
override this to interpolate additional properties.
"""
return Vertex(self.pos.lerp(other.pos, t),... | [
"Create",
"a",
"new",
"vertex",
"between",
"this",
"vertex",
"and",
"other",
"by",
"linearly",
"interpolating",
"all",
"properties",
"using",
"a",
"parameter",
"of",
"t",
".",
"Subclasses",
"should",
"override",
"this",
"to",
"interpolate",
"additional",
"proper... | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L147-L154 | [
"def",
"interpolate",
"(",
"self",
",",
"other",
",",
"t",
")",
":",
"return",
"Vertex",
"(",
"self",
".",
"pos",
".",
"lerp",
"(",
"other",
".",
"pos",
",",
"t",
")",
",",
"self",
".",
"normal",
".",
"lerp",
"(",
"other",
".",
"normal",
",",
"... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | Plane.splitPolygon | Split `polygon` by this plane if needed, then put the polygon or polygon
fragments in the appropriate lists. Coplanar polygons go into either
`coplanarFront` or `coplanarBack` depending on their orientation with
respect to this plane. Polygons in front or in back of this plane go into
ei... | csg/geom.py | def splitPolygon(self, polygon, coplanarFront, coplanarBack, front, back):
"""
Split `polygon` by this plane if needed, then put the polygon or polygon
fragments in the appropriate lists. Coplanar polygons go into either
`coplanarFront` or `coplanarBack` depending on their orientation wi... | def splitPolygon(self, polygon, coplanarFront, coplanarBack, front, back):
"""
Split `polygon` by this plane if needed, then put the polygon or polygon
fragments in the appropriate lists. Coplanar polygons go into either
`coplanarFront` or `coplanarBack` depending on their orientation wi... | [
"Split",
"polygon",
"by",
"this",
"plane",
"if",
"needed",
"then",
"put",
"the",
"polygon",
"or",
"polygon",
"fragments",
"in",
"the",
"appropriate",
"lists",
".",
"Coplanar",
"polygons",
"go",
"into",
"either",
"coplanarFront",
"or",
"coplanarBack",
"depending"... | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L192-L260 | [
"def",
"splitPolygon",
"(",
"self",
",",
"polygon",
",",
"coplanarFront",
",",
"coplanarBack",
",",
"front",
",",
"back",
")",
":",
"COPLANAR",
"=",
"0",
"# all the vertices are within EPSILON distance from plane",
"FRONT",
"=",
"1",
"# all the vertices are in front of ... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | BSPNode.invert | Convert solid space to empty space and empty space to solid space. | csg/geom.py | def invert(self):
"""
Convert solid space to empty space and empty space to solid space.
"""
for poly in self.polygons:
poly.flip()
self.plane.flip()
if self.front:
self.front.invert()
if self.back:
self.back.invert()
... | def invert(self):
"""
Convert solid space to empty space and empty space to solid space.
"""
for poly in self.polygons:
poly.flip()
self.plane.flip()
if self.front:
self.front.invert()
if self.back:
self.back.invert()
... | [
"Convert",
"solid",
"space",
"to",
"empty",
"space",
"and",
"empty",
"space",
"to",
"solid",
"space",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L323-L336 | [
"def",
"invert",
"(",
"self",
")",
":",
"for",
"poly",
"in",
"self",
".",
"polygons",
":",
"poly",
".",
"flip",
"(",
")",
"self",
".",
"plane",
".",
"flip",
"(",
")",
"if",
"self",
".",
"front",
":",
"self",
".",
"front",
".",
"invert",
"(",
")... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | BSPNode.clipPolygons | Recursively remove all polygons in `polygons` that are inside this BSP
tree. | csg/geom.py | def clipPolygons(self, polygons):
"""
Recursively remove all polygons in `polygons` that are inside this BSP
tree.
"""
if not self.plane:
return polygons[:]
front = []
back = []
for poly in polygons:
self.plane.splitPolygon(poly,... | def clipPolygons(self, polygons):
"""
Recursively remove all polygons in `polygons` that are inside this BSP
tree.
"""
if not self.plane:
return polygons[:]
front = []
back = []
for poly in polygons:
self.plane.splitPolygon(poly,... | [
"Recursively",
"remove",
"all",
"polygons",
"in",
"polygons",
"that",
"are",
"inside",
"this",
"BSP",
"tree",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L338-L360 | [
"def",
"clipPolygons",
"(",
"self",
",",
"polygons",
")",
":",
"if",
"not",
"self",
".",
"plane",
":",
"return",
"polygons",
"[",
":",
"]",
"front",
"=",
"[",
"]",
"back",
"=",
"[",
"]",
"for",
"poly",
"in",
"polygons",
":",
"self",
".",
"plane",
... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | BSPNode.clipTo | Remove all polygons in this BSP tree that are inside the other BSP tree
`bsp`. | csg/geom.py | def clipTo(self, bsp):
"""
Remove all polygons in this BSP tree that are inside the other BSP tree
`bsp`.
"""
self.polygons = bsp.clipPolygons(self.polygons)
if self.front:
self.front.clipTo(bsp)
if self.back:
self.back.clipTo(bsp) | def clipTo(self, bsp):
"""
Remove all polygons in this BSP tree that are inside the other BSP tree
`bsp`.
"""
self.polygons = bsp.clipPolygons(self.polygons)
if self.front:
self.front.clipTo(bsp)
if self.back:
self.back.clipTo(bsp) | [
"Remove",
"all",
"polygons",
"in",
"this",
"BSP",
"tree",
"that",
"are",
"inside",
"the",
"other",
"BSP",
"tree",
"bsp",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L362-L371 | [
"def",
"clipTo",
"(",
"self",
",",
"bsp",
")",
":",
"self",
".",
"polygons",
"=",
"bsp",
".",
"clipPolygons",
"(",
"self",
".",
"polygons",
")",
"if",
"self",
".",
"front",
":",
"self",
".",
"front",
".",
"clipTo",
"(",
"bsp",
")",
"if",
"self",
... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | BSPNode.allPolygons | Return a list of all polygons in this BSP tree. | csg/geom.py | def allPolygons(self):
"""
Return a list of all polygons in this BSP tree.
"""
polygons = self.polygons[:]
if self.front:
polygons.extend(self.front.allPolygons())
if self.back:
polygons.extend(self.back.allPolygons())
return polygons | def allPolygons(self):
"""
Return a list of all polygons in this BSP tree.
"""
polygons = self.polygons[:]
if self.front:
polygons.extend(self.front.allPolygons())
if self.back:
polygons.extend(self.back.allPolygons())
return polygons | [
"Return",
"a",
"list",
"of",
"all",
"polygons",
"in",
"this",
"BSP",
"tree",
"."
] | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L373-L382 | [
"def",
"allPolygons",
"(",
"self",
")",
":",
"polygons",
"=",
"self",
".",
"polygons",
"[",
":",
"]",
"if",
"self",
".",
"front",
":",
"polygons",
".",
"extend",
"(",
"self",
".",
"front",
".",
"allPolygons",
"(",
")",
")",
"if",
"self",
".",
"back... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | BSPNode.build | Build a BSP tree out of `polygons`. When called on an existing tree, the
new polygons are filtered down to the bottom of the tree and become new
nodes there. Each set of polygons is partitioned using the first polygon
(no heuristic is used to pick a good split). | csg/geom.py | def build(self, polygons):
"""
Build a BSP tree out of `polygons`. When called on an existing tree, the
new polygons are filtered down to the bottom of the tree and become new
nodes there. Each set of polygons is partitioned using the first polygon
(no heuristic is used to pick a... | def build(self, polygons):
"""
Build a BSP tree out of `polygons`. When called on an existing tree, the
new polygons are filtered down to the bottom of the tree and become new
nodes there. Each set of polygons is partitioned using the first polygon
(no heuristic is used to pick a... | [
"Build",
"a",
"BSP",
"tree",
"out",
"of",
"polygons",
".",
"When",
"called",
"on",
"an",
"existing",
"tree",
"the",
"new",
"polygons",
"are",
"filtered",
"down",
"to",
"the",
"bottom",
"of",
"the",
"tree",
"and",
"become",
"new",
"nodes",
"there",
".",
... | timknip/pycsg | python | https://github.com/timknip/pycsg/blob/b8f9710fd15c38dcc275d56a2108f604af38dcc8/csg/geom.py#L384-L412 | [
"def",
"build",
"(",
"self",
",",
"polygons",
")",
":",
"if",
"len",
"(",
"polygons",
")",
"==",
"0",
":",
"return",
"if",
"not",
"self",
".",
"plane",
":",
"self",
".",
"plane",
"=",
"polygons",
"[",
"0",
"]",
".",
"plane",
".",
"clone",
"(",
... | b8f9710fd15c38dcc275d56a2108f604af38dcc8 |
train | get_rate | Returns the rate from the default currency to `currency`. | djmoney_rates/utils.py | def get_rate(currency):
"""Returns the rate from the default currency to `currency`."""
source = get_rate_source()
try:
return Rate.objects.get(source=source, currency=currency).value
except Rate.DoesNotExist:
raise CurrencyConversionException(
"Rate for %s in %s do not exist... | def get_rate(currency):
"""Returns the rate from the default currency to `currency`."""
source = get_rate_source()
try:
return Rate.objects.get(source=source, currency=currency).value
except Rate.DoesNotExist:
raise CurrencyConversionException(
"Rate for %s in %s do not exist... | [
"Returns",
"the",
"rate",
"from",
"the",
"default",
"currency",
"to",
"currency",
"."
] | evonove/django-money-rates | python | https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L12-L21 | [
"def",
"get_rate",
"(",
"currency",
")",
":",
"source",
"=",
"get_rate_source",
"(",
")",
"try",
":",
"return",
"Rate",
".",
"objects",
".",
"get",
"(",
"source",
"=",
"source",
",",
"currency",
"=",
"currency",
")",
".",
"value",
"except",
"Rate",
"."... | ac1f7636b9a38d3e153eb833019342c4d88634c2 |
train | get_rate_source | Get the default Rate Source and return it. | djmoney_rates/utils.py | def get_rate_source():
"""Get the default Rate Source and return it."""
backend = money_rates_settings.DEFAULT_BACKEND()
try:
return RateSource.objects.get(name=backend.get_source_name())
except RateSource.DoesNotExist:
raise CurrencyConversionException(
"Rate for %s source d... | def get_rate_source():
"""Get the default Rate Source and return it."""
backend = money_rates_settings.DEFAULT_BACKEND()
try:
return RateSource.objects.get(name=backend.get_source_name())
except RateSource.DoesNotExist:
raise CurrencyConversionException(
"Rate for %s source d... | [
"Get",
"the",
"default",
"Rate",
"Source",
"and",
"return",
"it",
"."
] | evonove/django-money-rates | python | https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L24-L32 | [
"def",
"get_rate_source",
"(",
")",
":",
"backend",
"=",
"money_rates_settings",
".",
"DEFAULT_BACKEND",
"(",
")",
"try",
":",
"return",
"RateSource",
".",
"objects",
".",
"get",
"(",
"name",
"=",
"backend",
".",
"get_source_name",
"(",
")",
")",
"except",
... | ac1f7636b9a38d3e153eb833019342c4d88634c2 |
train | base_convert_money | Convert 'amount' from 'currency_from' to 'currency_to' | djmoney_rates/utils.py | def base_convert_money(amount, currency_from, currency_to):
"""
Convert 'amount' from 'currency_from' to 'currency_to'
"""
source = get_rate_source()
# Get rate for currency_from.
if source.base_currency != currency_from:
rate_from = get_rate(currency_from)
else:
# If curren... | def base_convert_money(amount, currency_from, currency_to):
"""
Convert 'amount' from 'currency_from' to 'currency_to'
"""
source = get_rate_source()
# Get rate for currency_from.
if source.base_currency != currency_from:
rate_from = get_rate(currency_from)
else:
# If curren... | [
"Convert",
"amount",
"from",
"currency_from",
"to",
"currency_to"
] | evonove/django-money-rates | python | https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L35-L55 | [
"def",
"base_convert_money",
"(",
"amount",
",",
"currency_from",
",",
"currency_to",
")",
":",
"source",
"=",
"get_rate_source",
"(",
")",
"# Get rate for currency_from.",
"if",
"source",
".",
"base_currency",
"!=",
"currency_from",
":",
"rate_from",
"=",
"get_rate... | ac1f7636b9a38d3e153eb833019342c4d88634c2 |
train | convert_money | Convert 'amount' from 'currency_from' to 'currency_to' and return a Money
instance of the converted amount. | djmoney_rates/utils.py | def convert_money(amount, currency_from, currency_to):
"""
Convert 'amount' from 'currency_from' to 'currency_to' and return a Money
instance of the converted amount.
"""
new_amount = base_convert_money(amount, currency_from, currency_to)
return moneyed.Money(new_amount, currency_to) | def convert_money(amount, currency_from, currency_to):
"""
Convert 'amount' from 'currency_from' to 'currency_to' and return a Money
instance of the converted amount.
"""
new_amount = base_convert_money(amount, currency_from, currency_to)
return moneyed.Money(new_amount, currency_to) | [
"Convert",
"amount",
"from",
"currency_from",
"to",
"currency_to",
"and",
"return",
"a",
"Money",
"instance",
"of",
"the",
"converted",
"amount",
"."
] | evonove/django-money-rates | python | https://github.com/evonove/django-money-rates/blob/ac1f7636b9a38d3e153eb833019342c4d88634c2/djmoney_rates/utils.py#L58-L64 | [
"def",
"convert_money",
"(",
"amount",
",",
"currency_from",
",",
"currency_to",
")",
":",
"new_amount",
"=",
"base_convert_money",
"(",
"amount",
",",
"currency_from",
",",
"currency_to",
")",
"return",
"moneyed",
".",
"Money",
"(",
"new_amount",
",",
"currency... | ac1f7636b9a38d3e153eb833019342c4d88634c2 |
train | format_date | Format a datetime object with Java SimpleDateFormat's-like string.
If datetime_obj is not given - use current datetime.
If format_string is not given - return number of millisecond since epoch.
:param format_string:
:param datetime_obj:
:return:
:rtype string | apiritif/utilities.py | def format_date(format_string=None, datetime_obj=None):
"""
Format a datetime object with Java SimpleDateFormat's-like string.
If datetime_obj is not given - use current datetime.
If format_string is not given - return number of millisecond since epoch.
:param format_string:
:param datetime_ob... | def format_date(format_string=None, datetime_obj=None):
"""
Format a datetime object with Java SimpleDateFormat's-like string.
If datetime_obj is not given - use current datetime.
If format_string is not given - return number of millisecond since epoch.
:param format_string:
:param datetime_ob... | [
"Format",
"a",
"datetime",
"object",
"with",
"Java",
"SimpleDateFormat",
"s",
"-",
"like",
"string",
"."
] | Blazemeter/apiritif | python | https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/utilities.py#L93-L112 | [
"def",
"format_date",
"(",
"format_string",
"=",
"None",
",",
"datetime_obj",
"=",
"None",
")",
":",
"datetime_obj",
"=",
"datetime_obj",
"or",
"datetime",
".",
"now",
"(",
")",
"if",
"format_string",
"is",
"None",
":",
"seconds",
"=",
"int",
"(",
"datetim... | 27b48a68425949998c2254e5e1e0226882d9eee8 |
train | allZero | Tries to determine if a buffer is empty.
@type buffer: str
@param buffer: Buffer to test if it is empty.
@rtype: bool
@return: C{True} if the given buffer is empty, i.e. full of zeros,
C{False} if it doesn't. | pype32/utils.py | def allZero(buffer):
"""
Tries to determine if a buffer is empty.
@type buffer: str
@param buffer: Buffer to test if it is empty.
@rtype: bool
@return: C{True} if the given buffer is empty, i.e. full of zeros,
C{False} if it doesn't.
"""
allZero = True
for byte ... | def allZero(buffer):
"""
Tries to determine if a buffer is empty.
@type buffer: str
@param buffer: Buffer to test if it is empty.
@rtype: bool
@return: C{True} if the given buffer is empty, i.e. full of zeros,
C{False} if it doesn't.
"""
allZero = True
for byte ... | [
"Tries",
"to",
"determine",
"if",
"a",
"buffer",
"is",
"empty",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L65-L81 | [
"def",
"allZero",
"(",
"buffer",
")",
":",
"allZero",
"=",
"True",
"for",
"byte",
"in",
"buffer",
":",
"if",
"byte",
"!=",
"\"\\x00\"",
":",
"allZero",
"=",
"False",
"break",
"return",
"allZero"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | WriteData.writeByte | Writes a byte into the L{WriteData} stream object.
@type byte: int
@param byte: Byte value to write into the stream. | pype32/utils.py | def writeByte(self, byte):
"""
Writes a byte into the L{WriteData} stream object.
@type byte: int
@param byte: Byte value to write into the stream.
"""
self.data.write(pack("B" if not self.signed else "b", byte)) | def writeByte(self, byte):
"""
Writes a byte into the L{WriteData} stream object.
@type byte: int
@param byte: Byte value to write into the stream.
"""
self.data.write(pack("B" if not self.signed else "b", byte)) | [
"Writes",
"a",
"byte",
"into",
"the",
"L",
"{",
"WriteData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L106-L113 | [
"def",
"writeByte",
"(",
"self",
",",
"byte",
")",
":",
"self",
".",
"data",
".",
"write",
"(",
"pack",
"(",
"\"B\"",
"if",
"not",
"self",
".",
"signed",
"else",
"\"b\"",
",",
"byte",
")",
")"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | WriteData.writeWord | Writes a word value into the L{WriteData} stream object.
@type word: int
@param word: Word value to write into the stream. | pype32/utils.py | def writeWord(self, word):
"""
Writes a word value into the L{WriteData} stream object.
@type word: int
@param word: Word value to write into the stream.
"""
self.data.write(pack(self.endianness + ("H" if not self.signed else "h"), word)) | def writeWord(self, word):
"""
Writes a word value into the L{WriteData} stream object.
@type word: int
@param word: Word value to write into the stream.
"""
self.data.write(pack(self.endianness + ("H" if not self.signed else "h"), word)) | [
"Writes",
"a",
"word",
"value",
"into",
"the",
"L",
"{",
"WriteData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L115-L122 | [
"def",
"writeWord",
"(",
"self",
",",
"word",
")",
":",
"self",
".",
"data",
".",
"write",
"(",
"pack",
"(",
"self",
".",
"endianness",
"+",
"(",
"\"H\"",
"if",
"not",
"self",
".",
"signed",
"else",
"\"h\"",
")",
",",
"word",
")",
")"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | WriteData.writeDword | Writes a dword value into the L{WriteData} stream object.
@type dword: int
@param dword: Dword value to write into the stream. | pype32/utils.py | def writeDword(self, dword):
"""
Writes a dword value into the L{WriteData} stream object.
@type dword: int
@param dword: Dword value to write into the stream.
"""
self.data.write(pack(self.endianness + ("L" if not self.signed else "l"), dword)) | def writeDword(self, dword):
"""
Writes a dword value into the L{WriteData} stream object.
@type dword: int
@param dword: Dword value to write into the stream.
"""
self.data.write(pack(self.endianness + ("L" if not self.signed else "l"), dword)) | [
"Writes",
"a",
"dword",
"value",
"into",
"the",
"L",
"{",
"WriteData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L124-L131 | [
"def",
"writeDword",
"(",
"self",
",",
"dword",
")",
":",
"self",
".",
"data",
".",
"write",
"(",
"pack",
"(",
"self",
".",
"endianness",
"+",
"(",
"\"L\"",
"if",
"not",
"self",
".",
"signed",
"else",
"\"l\"",
")",
",",
"dword",
")",
")"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | WriteData.writeQword | Writes a qword value into the L{WriteData} stream object.
@type qword: int
@param qword: Qword value to write into the stream. | pype32/utils.py | def writeQword(self, qword):
"""
Writes a qword value into the L{WriteData} stream object.
@type qword: int
@param qword: Qword value to write into the stream.
"""
self.data.write(pack(self.endianness + ("Q" if not self.signed else "q"), qword)) | def writeQword(self, qword):
"""
Writes a qword value into the L{WriteData} stream object.
@type qword: int
@param qword: Qword value to write into the stream.
"""
self.data.write(pack(self.endianness + ("Q" if not self.signed else "q"), qword)) | [
"Writes",
"a",
"qword",
"value",
"into",
"the",
"L",
"{",
"WriteData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L133-L140 | [
"def",
"writeQword",
"(",
"self",
",",
"qword",
")",
":",
"self",
".",
"data",
".",
"write",
"(",
"pack",
"(",
"self",
".",
"endianness",
"+",
"(",
"\"Q\"",
"if",
"not",
"self",
".",
"signed",
"else",
"\"q\"",
")",
",",
"qword",
")",
")"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | WriteData.setOffset | Sets the offset of the L{WriteData} stream object in wich the data is written.
@type value: int
@param value: Integer value that represent the offset we want to start writing in the L{WriteData} stream.
@raise WrongOffsetValueException: The value is beyond the total length ... | pype32/utils.py | def setOffset(self, value):
"""
Sets the offset of the L{WriteData} stream object in wich the data is written.
@type value: int
@param value: Integer value that represent the offset we want to start writing in the L{WriteData} stream.
@raise WrongOffsetValue... | def setOffset(self, value):
"""
Sets the offset of the L{WriteData} stream object in wich the data is written.
@type value: int
@param value: Integer value that represent the offset we want to start writing in the L{WriteData} stream.
@raise WrongOffsetValue... | [
"Sets",
"the",
"offset",
"of",
"the",
"L",
"{",
"WriteData",
"}",
"stream",
"object",
"in",
"wich",
"the",
"data",
"is",
"written",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L151-L162 | [
"def",
"setOffset",
"(",
"self",
",",
"value",
")",
":",
"if",
"value",
">=",
"len",
"(",
"self",
".",
"data",
".",
"getvalue",
"(",
")",
")",
":",
"raise",
"excep",
".",
"WrongOffsetValueException",
"(",
"\"Wrong offset value. Must be less than %d\"",
"%",
... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | WriteData.skipBytes | Skips the specified number as parameter to the current value of the L{WriteData} stream.
@type nroBytes: int
@param nroBytes: The number of bytes to skip. | pype32/utils.py | def skipBytes(self, nroBytes):
"""
Skips the specified number as parameter to the current value of the L{WriteData} stream.
@type nroBytes: int
@param nroBytes: The number of bytes to skip.
"""
self.data.seek(nroBytes + self.data.tell()) | def skipBytes(self, nroBytes):
"""
Skips the specified number as parameter to the current value of the L{WriteData} stream.
@type nroBytes: int
@param nroBytes: The number of bytes to skip.
"""
self.data.seek(nroBytes + self.data.tell()) | [
"Skips",
"the",
"specified",
"number",
"as",
"parameter",
"to",
"the",
"current",
"value",
"of",
"the",
"L",
"{",
"WriteData",
"}",
"stream",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L164-L171 | [
"def",
"skipBytes",
"(",
"self",
",",
"nroBytes",
")",
":",
"self",
".",
"data",
".",
"seek",
"(",
"nroBytes",
"+",
"self",
".",
"data",
".",
"tell",
"(",
")",
")"
] | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readDword | Reads a dword value from the L{ReadData} stream object.
@rtype: int
@return: The dword value read from the L{ReadData} stream. | pype32/utils.py | def readDword(self):
"""
Reads a dword value from the L{ReadData} stream object.
@rtype: int
@return: The dword value read from the L{ReadData} stream.
"""
dword = unpack(self.endianness + ('L' if not self.signed else 'l'), self.readAt(self.offset, 4))[0]
... | def readDword(self):
"""
Reads a dword value from the L{ReadData} stream object.
@rtype: int
@return: The dword value read from the L{ReadData} stream.
"""
dword = unpack(self.endianness + ('L' if not self.signed else 'l'), self.readAt(self.offset, 4))[0]
... | [
"Reads",
"a",
"dword",
"value",
"from",
"the",
"L",
"{",
"ReadData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L209-L218 | [
"def",
"readDword",
"(",
"self",
")",
":",
"dword",
"=",
"unpack",
"(",
"self",
".",
"endianness",
"+",
"(",
"'L'",
"if",
"not",
"self",
".",
"signed",
"else",
"'l'",
")",
",",
"self",
".",
"readAt",
"(",
"self",
".",
"offset",
",",
"4",
")",
")"... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readWord | Reads a word value from the L{ReadData} stream object.
@rtype: int
@return: The word value read from the L{ReadData} stream. | pype32/utils.py | def readWord(self):
"""
Reads a word value from the L{ReadData} stream object.
@rtype: int
@return: The word value read from the L{ReadData} stream.
"""
word = unpack(self.endianness + ('H' if not self.signed else 'h'), self.readAt(self.offset, 2))[0]
sel... | def readWord(self):
"""
Reads a word value from the L{ReadData} stream object.
@rtype: int
@return: The word value read from the L{ReadData} stream.
"""
word = unpack(self.endianness + ('H' if not self.signed else 'h'), self.readAt(self.offset, 2))[0]
sel... | [
"Reads",
"a",
"word",
"value",
"from",
"the",
"L",
"{",
"ReadData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L220-L229 | [
"def",
"readWord",
"(",
"self",
")",
":",
"word",
"=",
"unpack",
"(",
"self",
".",
"endianness",
"+",
"(",
"'H'",
"if",
"not",
"self",
".",
"signed",
"else",
"'h'",
")",
",",
"self",
".",
"readAt",
"(",
"self",
".",
"offset",
",",
"2",
")",
")",
... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readByte | Reads a byte value from the L{ReadData} stream object.
@rtype: int
@return: The byte value read from the L{ReadData} stream. | pype32/utils.py | def readByte(self):
"""
Reads a byte value from the L{ReadData} stream object.
@rtype: int
@return: The byte value read from the L{ReadData} stream.
"""
byte = unpack('B' if not self.signed else 'b', self.readAt(self.offset, 1))[0]
self.offset += 1
... | def readByte(self):
"""
Reads a byte value from the L{ReadData} stream object.
@rtype: int
@return: The byte value read from the L{ReadData} stream.
"""
byte = unpack('B' if not self.signed else 'b', self.readAt(self.offset, 1))[0]
self.offset += 1
... | [
"Reads",
"a",
"byte",
"value",
"from",
"the",
"L",
"{",
"ReadData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L231-L240 | [
"def",
"readByte",
"(",
"self",
")",
":",
"byte",
"=",
"unpack",
"(",
"'B'",
"if",
"not",
"self",
".",
"signed",
"else",
"'b'",
",",
"self",
".",
"readAt",
"(",
"self",
".",
"offset",
",",
"1",
")",
")",
"[",
"0",
"]",
"self",
".",
"offset",
"+... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readQword | Reads a qword value from the L{ReadData} stream object.
@rtype: int
@return: The qword value read from the L{ReadData} stream. | pype32/utils.py | def readQword(self):
"""
Reads a qword value from the L{ReadData} stream object.
@rtype: int
@return: The qword value read from the L{ReadData} stream.
"""
qword = unpack(self.endianness + ('Q' if not self.signed else 'b'), self.readAt(self.offset, 8))[0]
... | def readQword(self):
"""
Reads a qword value from the L{ReadData} stream object.
@rtype: int
@return: The qword value read from the L{ReadData} stream.
"""
qword = unpack(self.endianness + ('Q' if not self.signed else 'b'), self.readAt(self.offset, 8))[0]
... | [
"Reads",
"a",
"qword",
"value",
"from",
"the",
"L",
"{",
"ReadData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L242-L251 | [
"def",
"readQword",
"(",
"self",
")",
":",
"qword",
"=",
"unpack",
"(",
"self",
".",
"endianness",
"+",
"(",
"'Q'",
"if",
"not",
"self",
".",
"signed",
"else",
"'b'",
")",
",",
"self",
".",
"readAt",
"(",
"self",
".",
"offset",
",",
"8",
")",
")"... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readString | Reads an ASCII string from the L{ReadData} stream object.
@rtype: str
@return: An ASCII string read form the stream. | pype32/utils.py | def readString(self):
"""
Reads an ASCII string from the L{ReadData} stream object.
@rtype: str
@return: An ASCII string read form the stream.
"""
resultStr = ""
while self.data[self.offset] != "\x00":
resultStr += self.data[self.offset]
... | def readString(self):
"""
Reads an ASCII string from the L{ReadData} stream object.
@rtype: str
@return: An ASCII string read form the stream.
"""
resultStr = ""
while self.data[self.offset] != "\x00":
resultStr += self.data[self.offset]
... | [
"Reads",
"an",
"ASCII",
"string",
"from",
"the",
"L",
"{",
"ReadData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L253-L264 | [
"def",
"readString",
"(",
"self",
")",
":",
"resultStr",
"=",
"\"\"",
"while",
"self",
".",
"data",
"[",
"self",
".",
"offset",
"]",
"!=",
"\"\\x00\"",
":",
"resultStr",
"+=",
"self",
".",
"data",
"[",
"self",
".",
"offset",
"]",
"self",
".",
"offset... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readAlignedString | Reads an ASCII string aligned to the next align-bytes boundary.
@type align: int
@param align: (Optional) The value we want the ASCII string to be aligned.
@rtype: str
@return: A 4-bytes aligned (default) ASCII string. | pype32/utils.py | def readAlignedString(self, align = 4):
"""
Reads an ASCII string aligned to the next align-bytes boundary.
@type align: int
@param align: (Optional) The value we want the ASCII string to be aligned.
@rtype: str
@return: A 4-bytes aligned (default) ASCI... | def readAlignedString(self, align = 4):
"""
Reads an ASCII string aligned to the next align-bytes boundary.
@type align: int
@param align: (Optional) The value we want the ASCII string to be aligned.
@rtype: str
@return: A 4-bytes aligned (default) ASCI... | [
"Reads",
"an",
"ASCII",
"string",
"aligned",
"to",
"the",
"next",
"align",
"-",
"bytes",
"boundary",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L266-L282 | [
"def",
"readAlignedString",
"(",
"self",
",",
"align",
"=",
"4",
")",
":",
"s",
"=",
"self",
".",
"readString",
"(",
")",
"r",
"=",
"align",
"-",
"len",
"(",
"s",
")",
"%",
"align",
"while",
"r",
":",
"s",
"+=",
"self",
".",
"data",
"[",
"self"... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.read | Reads data from the L{ReadData} stream object.
@type nroBytes: int
@param nroBytes: The number of bytes to read.
@rtype: str
@return: A string containing the read data from the L{ReadData} stream object.
@raise DataLengthException: The number of bytes t... | pype32/utils.py | def read(self, nroBytes):
"""
Reads data from the L{ReadData} stream object.
@type nroBytes: int
@param nroBytes: The number of bytes to read.
@rtype: str
@return: A string containing the read data from the L{ReadData} stream object.
@ra... | def read(self, nroBytes):
"""
Reads data from the L{ReadData} stream object.
@type nroBytes: int
@param nroBytes: The number of bytes to read.
@rtype: str
@return: A string containing the read data from the L{ReadData} stream object.
@ra... | [
"Reads",
"data",
"from",
"the",
"L",
"{",
"ReadData",
"}",
"stream",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L284-L303 | [
"def",
"read",
"(",
"self",
",",
"nroBytes",
")",
":",
"if",
"nroBytes",
">",
"self",
".",
"length",
"-",
"self",
".",
"offset",
":",
"if",
"self",
".",
"log",
":",
"print",
"\"Warning: Trying to read: %d bytes - only %d bytes left\"",
"%",
"(",
"nroBytes",
... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ReadData.readAt | Reads as many bytes indicated in the size parameter at the specific offset.
@type offset: int
@param offset: Offset of the value to be read.
@type size: int
@param size: This parameter indicates how many bytes are going to be read from a given offset.
@rtype: str
@retu... | pype32/utils.py | def readAt(self, offset, size):
"""
Reads as many bytes indicated in the size parameter at the specific offset.
@type offset: int
@param offset: Offset of the value to be read.
@type size: int
@param size: This parameter indicates how many bytes are going to be read fro... | def readAt(self, offset, size):
"""
Reads as many bytes indicated in the size parameter at the specific offset.
@type offset: int
@param offset: Offset of the value to be read.
@type size: int
@param size: This parameter indicates how many bytes are going to be read fro... | [
"Reads",
"as",
"many",
"bytes",
"indicated",
"in",
"the",
"size",
"parameter",
"at",
"the",
"specific",
"offset",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/utils.py#L327-L348 | [
"def",
"readAt",
"(",
"self",
",",
"offset",
",",
"size",
")",
":",
"if",
"offset",
">",
"self",
".",
"length",
":",
"if",
"self",
".",
"log",
":",
"print",
"\"Warning: Trying to read: %d bytes - only %d bytes left\"",
"%",
"(",
"nroBytes",
",",
"self",
".",... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | Kawasemi.send | Send a notification to channels
:param message: A message | kawasemi/kawasemi.py | def send(self, message, channel_name=None, fail_silently=False,
options=None):
# type: (Text, Optional[str], bool, Optional[SendOptions]) -> None
"""Send a notification to channels
:param message: A message
"""
if channel_name is None:
channels = self.se... | def send(self, message, channel_name=None, fail_silently=False,
options=None):
# type: (Text, Optional[str], bool, Optional[SendOptions]) -> None
"""Send a notification to channels
:param message: A message
"""
if channel_name is None:
channels = self.se... | [
"Send",
"a",
"notification",
"to",
"channels"
] | ymyzk/kawasemi | python | https://github.com/ymyzk/kawasemi/blob/a9f62f38ee7c10bf4cd353285db1f477d3d372d1/kawasemi/kawasemi.py#L35-L61 | [
"def",
"send",
"(",
"self",
",",
"message",
",",
"channel_name",
"=",
"None",
",",
"fail_silently",
"=",
"False",
",",
"options",
"=",
"None",
")",
":",
"# type: (Text, Optional[str], bool, Optional[SendOptions]) -> None",
"if",
"channel_name",
"is",
"None",
":",
... | a9f62f38ee7c10bf4cd353285db1f477d3d372d1 |
train | HTTPTarget.request | Prepares and sends an HTTP request. Returns the HTTPResponse object.
:param method: str
:param path: str
:return: response
:rtype: HTTPResponse | apiritif/http.py | def request(self, method, path,
params=None, headers=None, cookies=None, data=None, json=None, allow_redirects=None, timeout=None):
"""
Prepares and sends an HTTP request. Returns the HTTPResponse object.
:param method: str
:param path: str
:return: response
... | def request(self, method, path,
params=None, headers=None, cookies=None, data=None, json=None, allow_redirects=None, timeout=None):
"""
Prepares and sends an HTTP request. Returns the HTTPResponse object.
:param method: str
:param path: str
:return: response
... | [
"Prepares",
"and",
"sends",
"an",
"HTTP",
"request",
".",
"Returns",
"the",
"HTTPResponse",
"object",
"."
] | Blazemeter/apiritif | python | https://github.com/Blazemeter/apiritif/blob/27b48a68425949998c2254e5e1e0226882d9eee8/apiritif/http.py#L392-L421 | [
"def",
"request",
"(",
"self",
",",
"method",
",",
"path",
",",
"params",
"=",
"None",
",",
"headers",
"=",
"None",
",",
"cookies",
"=",
"None",
",",
"data",
"=",
"None",
",",
"json",
"=",
"None",
",",
"allow_redirects",
"=",
"None",
",",
"timeout",
... | 27b48a68425949998c2254e5e1e0226882d9eee8 |
train | load_genomic_CDR3_anchor_pos_and_functionality | Read anchor position and functionality from file.
Parameters
----------
anchor_pos_file_name : str
File name for the functionality and position of a conserved residue
that defines the CDR3 region for each V or J germline sequence.
Returns
-------
anchor_pos_and_functio... | olga/load_model.py | def load_genomic_CDR3_anchor_pos_and_functionality(anchor_pos_file_name):
"""Read anchor position and functionality from file.
Parameters
----------
anchor_pos_file_name : str
File name for the functionality and position of a conserved residue
that defines the CDR3 region for each V or... | def load_genomic_CDR3_anchor_pos_and_functionality(anchor_pos_file_name):
"""Read anchor position and functionality from file.
Parameters
----------
anchor_pos_file_name : str
File name for the functionality and position of a conserved residue
that defines the CDR3 region for each V or... | [
"Read",
"anchor",
"position",
"and",
"functionality",
"from",
"file",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L468-L497 | [
"def",
"load_genomic_CDR3_anchor_pos_and_functionality",
"(",
"anchor_pos_file_name",
")",
":",
"anchor_pos_and_functionality",
"=",
"{",
"}",
"anchor_pos_file",
"=",
"open",
"(",
"anchor_pos_file_name",
",",
"'r'",
")",
"first_line",
"=",
"True",
"for",
"line",
"in",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | read_igor_V_gene_parameters | Load raw genV from file.
genV is a list of genomic V information. Each element is a list of three
elements. The first is the name of the V allele, the second is the genomic
sequence trimmed to the CDR3 region for productive sequences, and the last
is the full germline sequence. For this 'raw gen... | olga/load_model.py | def read_igor_V_gene_parameters(params_file_name):
"""Load raw genV from file.
genV is a list of genomic V information. Each element is a list of three
elements. The first is the name of the V allele, the second is the genomic
sequence trimmed to the CDR3 region for productive sequences, and the ... | def read_igor_V_gene_parameters(params_file_name):
"""Load raw genV from file.
genV is a list of genomic V information. Each element is a list of three
elements. The first is the name of the V allele, the second is the genomic
sequence trimmed to the CDR3 region for productive sequences, and the ... | [
"Load",
"raw",
"genV",
"from",
"file",
".",
"genV",
"is",
"a",
"list",
"of",
"genomic",
"V",
"information",
".",
"Each",
"element",
"is",
"a",
"list",
"of",
"three",
"elements",
".",
"The",
"first",
"is",
"the",
"name",
"of",
"the",
"V",
"allele",
"t... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L499-L540 | [
"def",
"read_igor_V_gene_parameters",
"(",
"params_file_name",
")",
":",
"params_file",
"=",
"open",
"(",
"params_file_name",
",",
"'r'",
")",
"V_gene_info",
"=",
"{",
"}",
"in_V_gene_sec",
"=",
"False",
"for",
"line",
"in",
"params_file",
":",
"if",
"line",
"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | read_igor_D_gene_parameters | Load genD from file.
genD is a list of genomic D information. Each element is a list of the name
of the D allele and the germline sequence.
Parameters
----------
params_file_name : str
File name for a IGOR parameter file.
Returns
-------
genD : list
List of genomic... | olga/load_model.py | def read_igor_D_gene_parameters(params_file_name):
"""Load genD from file.
genD is a list of genomic D information. Each element is a list of the name
of the D allele and the germline sequence.
Parameters
----------
params_file_name : str
File name for a IGOR parameter file.
R... | def read_igor_D_gene_parameters(params_file_name):
"""Load genD from file.
genD is a list of genomic D information. Each element is a list of the name
of the D allele and the germline sequence.
Parameters
----------
params_file_name : str
File name for a IGOR parameter file.
R... | [
"Load",
"genD",
"from",
"file",
".",
"genD",
"is",
"a",
"list",
"of",
"genomic",
"D",
"information",
".",
"Each",
"element",
"is",
"a",
"list",
"of",
"the",
"name",
"of",
"the",
"D",
"allele",
"and",
"the",
"germline",
"sequence",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L542-L580 | [
"def",
"read_igor_D_gene_parameters",
"(",
"params_file_name",
")",
":",
"params_file",
"=",
"open",
"(",
"params_file_name",
",",
"'r'",
")",
"D_gene_info",
"=",
"{",
"}",
"in_D_gene_sec",
"=",
"False",
"for",
"line",
"in",
"params_file",
":",
"if",
"line",
"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | read_igor_J_gene_parameters | Load raw genJ from file.
genJ is a list of genomic J information. Each element is a list of three
elements. The first is the name of the J allele, the second is the genomic
sequence trimmed to the CDR3 region for productive sequences, and the last
is the full germline sequence. For this 'raw gen... | olga/load_model.py | def read_igor_J_gene_parameters(params_file_name):
"""Load raw genJ from file.
genJ is a list of genomic J information. Each element is a list of three
elements. The first is the name of the J allele, the second is the genomic
sequence trimmed to the CDR3 region for productive sequences, and the ... | def read_igor_J_gene_parameters(params_file_name):
"""Load raw genJ from file.
genJ is a list of genomic J information. Each element is a list of three
elements. The first is the name of the J allele, the second is the genomic
sequence trimmed to the CDR3 region for productive sequences, and the ... | [
"Load",
"raw",
"genJ",
"from",
"file",
".",
"genJ",
"is",
"a",
"list",
"of",
"genomic",
"J",
"information",
".",
"Each",
"element",
"is",
"a",
"list",
"of",
"three",
"elements",
".",
"The",
"first",
"is",
"the",
"name",
"of",
"the",
"J",
"allele",
"t... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L582-L623 | [
"def",
"read_igor_J_gene_parameters",
"(",
"params_file_name",
")",
":",
"params_file",
"=",
"open",
"(",
"params_file_name",
",",
"'r'",
")",
"J_gene_info",
"=",
"{",
"}",
"in_J_gene_sec",
"=",
"False",
"for",
"line",
"in",
"params_file",
":",
"if",
"line",
"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | read_igor_marginals_txt | Load raw IGoR model marginals.
Parameters
----------
marginals_file_name : str
File name for a IGOR model marginals file.
Returns
-------
model_dict : dict
Dictionary with model marginals.
dimension_names_dict : dict
Dictionary that defines IGoR model dependecie... | olga/load_model.py | def read_igor_marginals_txt(marginals_file_name , dim_names=False):
"""Load raw IGoR model marginals.
Parameters
----------
marginals_file_name : str
File name for a IGOR model marginals file.
Returns
-------
model_dict : dict
Dictionary with model marginals.
dimens... | def read_igor_marginals_txt(marginals_file_name , dim_names=False):
"""Load raw IGoR model marginals.
Parameters
----------
marginals_file_name : str
File name for a IGOR model marginals file.
Returns
-------
model_dict : dict
Dictionary with model marginals.
dimens... | [
"Load",
"raw",
"IGoR",
"model",
"marginals",
".",
"Parameters",
"----------",
"marginals_file_name",
":",
"str",
"File",
"name",
"for",
"a",
"IGOR",
"model",
"marginals",
"file",
"."
] | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L790-L892 | [
"def",
"read_igor_marginals_txt",
"(",
"marginals_file_name",
",",
"dim_names",
"=",
"False",
")",
":",
"with",
"open",
"(",
"marginals_file_name",
",",
"'r'",
")",
"as",
"file",
":",
"#Model parameters are stored inside a dictionary of ndarrays",
"model_dict",
"=",
"{"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicData.anchor_and_curate_genV_and_genJ | Trim V and J germline sequences to the CDR3 region.
Unproductive sequences have an empty string '' for the CDR3 region
sequence.
Edits the attributes genV and genJ
Parameters
----------
V_anchor_pos_file_name : str
File name for the ... | olga/load_model.py | def anchor_and_curate_genV_and_genJ(self, V_anchor_pos_file, J_anchor_pos_file):
"""Trim V and J germline sequences to the CDR3 region.
Unproductive sequences have an empty string '' for the CDR3 region
sequence.
Edits the attributes genV and genJ
Param... | def anchor_and_curate_genV_and_genJ(self, V_anchor_pos_file, J_anchor_pos_file):
"""Trim V and J germline sequences to the CDR3 region.
Unproductive sequences have an empty string '' for the CDR3 region
sequence.
Edits the attributes genV and genJ
Param... | [
"Trim",
"V",
"and",
"J",
"germline",
"sequences",
"to",
"the",
"CDR3",
"region",
".",
"Unproductive",
"sequences",
"have",
"an",
"empty",
"string",
"for",
"the",
"CDR3",
"region",
"sequence",
".",
"Edits",
"the",
"attributes",
"genV",
"and",
"genJ",
"Paramet... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L129-L167 | [
"def",
"anchor_and_curate_genV_and_genJ",
"(",
"self",
",",
"V_anchor_pos_file",
",",
"J_anchor_pos_file",
")",
":",
"V_anchor_pos",
"=",
"load_genomic_CDR3_anchor_pos_and_functionality",
"(",
"V_anchor_pos_file",
")",
"J_anchor_pos",
"=",
"load_genomic_CDR3_anchor_pos_and_functi... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicData.generate_cutV_genomic_CDR3_segs | Add palindromic inserted nucleotides to germline V sequences.
The maximum number of palindromic insertions are appended to the
germline V segments so that delV can index directly for number of
nucleotides to delete from a segment.
Sets the attribute cutV_genomic_CDR3_se... | olga/load_model.py | def generate_cutV_genomic_CDR3_segs(self):
"""Add palindromic inserted nucleotides to germline V sequences.
The maximum number of palindromic insertions are appended to the
germline V segments so that delV can index directly for number of
nucleotides to delete from a segment.
... | def generate_cutV_genomic_CDR3_segs(self):
"""Add palindromic inserted nucleotides to germline V sequences.
The maximum number of palindromic insertions are appended to the
germline V segments so that delV can index directly for number of
nucleotides to delete from a segment.
... | [
"Add",
"palindromic",
"inserted",
"nucleotides",
"to",
"germline",
"V",
"sequences",
".",
"The",
"maximum",
"number",
"of",
"palindromic",
"insertions",
"are",
"appended",
"to",
"the",
"germline",
"V",
"segments",
"so",
"that",
"delV",
"can",
"index",
"directly"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L169-L187 | [
"def",
"generate_cutV_genomic_CDR3_segs",
"(",
"self",
")",
":",
"max_palindrome",
"=",
"self",
".",
"max_delV_palindrome",
"self",
".",
"cutV_genomic_CDR3_segs",
"=",
"[",
"]",
"for",
"CDR3_V_seg",
"in",
"[",
"x",
"[",
"1",
"]",
"for",
"x",
"in",
"self",
".... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicData.generate_cutJ_genomic_CDR3_segs | Add palindromic inserted nucleotides to germline J sequences.
The maximum number of palindromic insertions are appended to the
germline J segments so that delJ can index directly for number of
nucleotides to delete from a segment.
Sets the attribute cutJ_genomic_CDR3_se... | olga/load_model.py | def generate_cutJ_genomic_CDR3_segs(self):
"""Add palindromic inserted nucleotides to germline J sequences.
The maximum number of palindromic insertions are appended to the
germline J segments so that delJ can index directly for number of
nucleotides to delete from a segment.
... | def generate_cutJ_genomic_CDR3_segs(self):
"""Add palindromic inserted nucleotides to germline J sequences.
The maximum number of palindromic insertions are appended to the
germline J segments so that delJ can index directly for number of
nucleotides to delete from a segment.
... | [
"Add",
"palindromic",
"inserted",
"nucleotides",
"to",
"germline",
"J",
"sequences",
".",
"The",
"maximum",
"number",
"of",
"palindromic",
"insertions",
"are",
"appended",
"to",
"the",
"germline",
"J",
"segments",
"so",
"that",
"delJ",
"can",
"index",
"directly"... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L189-L206 | [
"def",
"generate_cutJ_genomic_CDR3_segs",
"(",
"self",
")",
":",
"max_palindrome",
"=",
"self",
".",
"max_delJ_palindrome",
"self",
".",
"cutJ_genomic_CDR3_segs",
"=",
"[",
"]",
"for",
"CDR3_J_seg",
"in",
"[",
"x",
"[",
"1",
"]",
"for",
"x",
"in",
"self",
".... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicDataVDJ.load_igor_genomic_data | Set attributes by loading in genomic data from IGoR parameter file.
Sets attributes genV, max_delV_palindrome, cutV_genomic_CDR3_segs,
genD, max_delDl_palindrome, max_delDr_palindrome,
cutD_genomic_CDR3_segs, genJ, max_delJ_palindrome, and
cutJ_genomic_CDR3_segs.
... | olga/load_model.py | def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file):
"""Set attributes by loading in genomic data from IGoR parameter file.
Sets attributes genV, max_delV_palindrome, cutV_genomic_CDR3_segs,
genD, max_delDl_palindrome, max_delDr_palindrome,
... | def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file):
"""Set attributes by loading in genomic data from IGoR parameter file.
Sets attributes genV, max_delV_palindrome, cutV_genomic_CDR3_segs,
genD, max_delDl_palindrome, max_delDr_palindrome,
... | [
"Set",
"attributes",
"by",
"loading",
"in",
"genomic",
"data",
"from",
"IGoR",
"parameter",
"file",
".",
"Sets",
"attributes",
"genV",
"max_delV_palindrome",
"cutV_genomic_CDR3_segs",
"genD",
"max_delDl_palindrome",
"max_delDr_palindrome",
"cutD_genomic_CDR3_segs",
"genJ",
... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L258-L289 | [
"def",
"load_igor_genomic_data",
"(",
"self",
",",
"params_file_name",
",",
"V_anchor_pos_file",
",",
"J_anchor_pos_file",
")",
":",
"self",
".",
"genV",
"=",
"read_igor_V_gene_parameters",
"(",
"params_file_name",
")",
"self",
".",
"genD",
"=",
"read_igor_D_gene_para... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicDataVDJ.generate_cutD_genomic_CDR3_segs | Add palindromic inserted nucleotides to germline V sequences.
The maximum number of palindromic insertions are appended to the
germline D segments so that delDl and delDr can index directly for number
of nucleotides to delete from a segment.
Sets the attribute cutV_gen... | olga/load_model.py | def generate_cutD_genomic_CDR3_segs(self):
"""Add palindromic inserted nucleotides to germline V sequences.
The maximum number of palindromic insertions are appended to the
germline D segments so that delDl and delDr can index directly for number
of nucleotides to delete from a... | def generate_cutD_genomic_CDR3_segs(self):
"""Add palindromic inserted nucleotides to germline V sequences.
The maximum number of palindromic insertions are appended to the
germline D segments so that delDl and delDr can index directly for number
of nucleotides to delete from a... | [
"Add",
"palindromic",
"inserted",
"nucleotides",
"to",
"germline",
"V",
"sequences",
".",
"The",
"maximum",
"number",
"of",
"palindromic",
"insertions",
"are",
"appended",
"to",
"the",
"germline",
"D",
"segments",
"so",
"that",
"delDl",
"and",
"delDr",
"can",
... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L291-L309 | [
"def",
"generate_cutD_genomic_CDR3_segs",
"(",
"self",
")",
":",
"max_palindrome_L",
"=",
"self",
".",
"max_delDl_palindrome",
"max_palindrome_R",
"=",
"self",
".",
"max_delDr_palindrome",
"self",
".",
"cutD_genomic_CDR3_segs",
"=",
"[",
"]",
"for",
"CDR3_D_seg",
"in"... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicDataVDJ.read_VDJ_palindrome_parameters | Read V, D, and J palindrome parameters from file.
Sets the attributes max_delV_palindrome, max_delDl_palindrome,
max_delDr_palindrome, and max_delJ_palindrome.
Parameters
----------
params_file_name : str
File name for an IGoR parameter file of a VDJ gen... | olga/load_model.py | def read_VDJ_palindrome_parameters(self, params_file_name):
"""Read V, D, and J palindrome parameters from file.
Sets the attributes max_delV_palindrome, max_delDl_palindrome,
max_delDr_palindrome, and max_delJ_palindrome.
Parameters
----------
params_file_n... | def read_VDJ_palindrome_parameters(self, params_file_name):
"""Read V, D, and J palindrome parameters from file.
Sets the attributes max_delV_palindrome, max_delDl_palindrome,
max_delDr_palindrome, and max_delJ_palindrome.
Parameters
----------
params_file_n... | [
"Read",
"V",
"D",
"and",
"J",
"palindrome",
"parameters",
"from",
"file",
".",
"Sets",
"the",
"attributes",
"max_delV_palindrome",
"max_delDl_palindrome",
"max_delDr_palindrome",
"and",
"max_delJ_palindrome",
".",
"Parameters",
"----------",
"params_file_name",
":",
"st... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L311-L368 | [
"def",
"read_VDJ_palindrome_parameters",
"(",
"self",
",",
"params_file_name",
")",
":",
"params_file",
"=",
"open",
"(",
"params_file_name",
",",
"'r'",
")",
"in_delV",
"=",
"False",
"in_delDl",
"=",
"False",
"in_delDr",
"=",
"False",
"in_delJ",
"=",
"False",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicDataVJ.load_igor_genomic_data | Set attributes by loading in genomic data from IGoR parameter file.
Sets attributes genV, genJ, max_delV_palindrome, max_delJ_palindrome,
cutV_genomic_CDR3_segs, and cutJ_genomic_CDR3_segs.
Parameters
----------
params_file_name : str
File name for a... | olga/load_model.py | def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file):
"""Set attributes by loading in genomic data from IGoR parameter file.
Sets attributes genV, genJ, max_delV_palindrome, max_delJ_palindrome,
cutV_genomic_CDR3_segs, and cutJ_genomic_CDR3_segs.
... | def load_igor_genomic_data(self, params_file_name, V_anchor_pos_file, J_anchor_pos_file):
"""Set attributes by loading in genomic data from IGoR parameter file.
Sets attributes genV, genJ, max_delV_palindrome, max_delJ_palindrome,
cutV_genomic_CDR3_segs, and cutJ_genomic_CDR3_segs.
... | [
"Set",
"attributes",
"by",
"loading",
"in",
"genomic",
"data",
"from",
"IGoR",
"parameter",
"file",
".",
"Sets",
"attributes",
"genV",
"genJ",
"max_delV_palindrome",
"max_delJ_palindrome",
"cutV_genomic_CDR3_segs",
"and",
"cutJ_genomic_CDR3_segs",
".",
"Parameters",
"--... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L401-L428 | [
"def",
"load_igor_genomic_data",
"(",
"self",
",",
"params_file_name",
",",
"V_anchor_pos_file",
",",
"J_anchor_pos_file",
")",
":",
"self",
".",
"genV",
"=",
"read_igor_V_gene_parameters",
"(",
"params_file_name",
")",
"self",
".",
"genJ",
"=",
"read_igor_J_gene_para... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenomicDataVJ.read_igor_VJ_palindrome_parameters | Read V and J palindrome parameters from file.
Sets the attributes max_delV_palindrome and max_delJ_palindrome.
Parameters
----------
params_file_name : str
File name for an IGoR parameter file of a VJ generative model. | olga/load_model.py | def read_igor_VJ_palindrome_parameters(self, params_file_name):
"""Read V and J palindrome parameters from file.
Sets the attributes max_delV_palindrome and max_delJ_palindrome.
Parameters
----------
params_file_name : str
File name for an IGoR parameter... | def read_igor_VJ_palindrome_parameters(self, params_file_name):
"""Read V and J palindrome parameters from file.
Sets the attributes max_delV_palindrome and max_delJ_palindrome.
Parameters
----------
params_file_name : str
File name for an IGoR parameter... | [
"Read",
"V",
"and",
"J",
"palindrome",
"parameters",
"from",
"file",
".",
"Sets",
"the",
"attributes",
"max_delV_palindrome",
"and",
"max_delJ_palindrome",
".",
"Parameters",
"----------",
"params_file_name",
":",
"str",
"File",
"name",
"for",
"an",
"IGoR",
"param... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L431-L464 | [
"def",
"read_igor_VJ_palindrome_parameters",
"(",
"self",
",",
"params_file_name",
")",
":",
"params_file",
"=",
"open",
"(",
"params_file_name",
",",
"'r'",
")",
"in_delV",
"=",
"False",
"in_delJ",
"=",
"False",
"for",
"line",
"in",
"params_file",
":",
"if",
... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerativeModelVDJ.load_and_process_igor_model | Set attributes by reading a generative model from IGoR marginal file.
Sets attributes PV, PdelV_given_V, PDJ, PdelJ_given_J,
PdelDldelDr_given_D, PinsVD, PinsDJ, Rvd, and Rdj.
Parameters
----------
marginals_file_name : str
File name for a IGoR mode... | olga/load_model.py | def load_and_process_igor_model(self, marginals_file_name):
"""Set attributes by reading a generative model from IGoR marginal file.
Sets attributes PV, PdelV_given_V, PDJ, PdelJ_given_J,
PdelDldelDr_given_D, PinsVD, PinsDJ, Rvd, and Rdj.
Parameters
----------
... | def load_and_process_igor_model(self, marginals_file_name):
"""Set attributes by reading a generative model from IGoR marginal file.
Sets attributes PV, PdelV_given_V, PDJ, PdelJ_given_J,
PdelDldelDr_given_D, PinsVD, PinsDJ, Rvd, and Rdj.
Parameters
----------
... | [
"Set",
"attributes",
"by",
"reading",
"a",
"generative",
"model",
"from",
"IGoR",
"marginal",
"file",
".",
"Sets",
"attributes",
"PV",
"PdelV_given_V",
"PDJ",
"PdelJ_given_J",
"PdelDldelDr_given_D",
"PinsVD",
"PinsDJ",
"Rvd",
"and",
"Rdj",
".",
"Parameters",
"----... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L681-L731 | [
"def",
"load_and_process_igor_model",
"(",
"self",
",",
"marginals_file_name",
")",
":",
"raw_model",
"=",
"read_igor_marginals_txt",
"(",
"marginals_file_name",
")",
"self",
".",
"PV",
"=",
"raw_model",
"[",
"0",
"]",
"[",
"'v_choice'",
"]",
"self",
".",
"PinsV... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | GenerativeModelVJ.load_and_process_igor_model | Set attributes by reading a generative model from IGoR marginal file.
Sets attributes PVJ, PdelV_given_V, PdelJ_given_J, PinsVJ, and Rvj.
Parameters
----------
marginals_file_name : str
File name for a IGoR model marginals file. | olga/load_model.py | def load_and_process_igor_model(self, marginals_file_name):
"""Set attributes by reading a generative model from IGoR marginal file.
Sets attributes PVJ, PdelV_given_V, PdelJ_given_J, PinsVJ, and Rvj.
Parameters
----------
marginals_file_name : str
F... | def load_and_process_igor_model(self, marginals_file_name):
"""Set attributes by reading a generative model from IGoR marginal file.
Sets attributes PVJ, PdelV_given_V, PdelJ_given_J, PinsVJ, and Rvj.
Parameters
----------
marginals_file_name : str
F... | [
"Set",
"attributes",
"by",
"reading",
"a",
"generative",
"model",
"from",
"IGoR",
"marginal",
"file",
".",
"Sets",
"attributes",
"PVJ",
"PdelV_given_V",
"PdelJ_given_J",
"PinsVJ",
"and",
"Rvj",
".",
"Parameters",
"----------",
"marginals_file_name",
":",
"str",
"F... | zsethna/OLGA | python | https://github.com/zsethna/OLGA/blob/e825c333f0f9a4eb02132e0bcf86f0dca9123114/olga/load_model.py#L768-L787 | [
"def",
"load_and_process_igor_model",
"(",
"self",
",",
"marginals_file_name",
")",
":",
"raw_model",
"=",
"read_igor_marginals_txt",
"(",
"marginals_file_name",
")",
"self",
".",
"PinsVJ",
"=",
"raw_model",
"[",
"0",
"]",
"[",
"'vj_ins'",
"]",
"self",
".",
"Pde... | e825c333f0f9a4eb02132e0bcf86f0dca9123114 |
train | ImageBoundForwarderRefEntry.parse | Returns a new L{ImageBoundForwarderRefEntry} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object.
@rtype: L{ImageBoundForwarderRefEntry}
@return: A ... | pype32/directories.py | def parse(readDataInstance):
"""
Returns a new L{ImageBoundForwarderRefEntry} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object.
@rtype: L... | def parse(readDataInstance):
"""
Returns a new L{ImageBoundForwarderRefEntry} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRefEntry} object.
@rtype: L... | [
"Returns",
"a",
"new",
"L",
"{",
"ImageBoundForwarderRefEntry",
"}",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L75-L89 | [
"def",
"parse",
"(",
"readDataInstance",
")",
":",
"boundForwarderEntry",
"=",
"ImageBoundForwarderRefEntry",
"(",
")",
"boundForwarderEntry",
".",
"timeDateStamp",
".",
"value",
"=",
"readDataInstance",
".",
"readDword",
"(",
")",
"boundForwarderEntry",
".",
"offsetM... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ImageBoundForwarderRef.parse | Returns a L{ImageBoundForwarderRef} array where every element is a L{ImageBoundForwarderRefEntry} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with the corresponding data to generate a new L{ImageBoundForwarderRef} object.
@type numb... | pype32/directories.py | def parse(readDataInstance, numberOfEntries):
"""
Returns a L{ImageBoundForwarderRef} array where every element is a L{ImageBoundForwarderRefEntry} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with the corresponding data to generate ... | def parse(readDataInstance, numberOfEntries):
"""
Returns a L{ImageBoundForwarderRef} array where every element is a L{ImageBoundForwarderRefEntry} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object with the corresponding data to generate ... | [
"Returns",
"a",
"L",
"{",
"ImageBoundForwarderRef",
"}",
"array",
"where",
"every",
"element",
"is",
"a",
"L",
"{",
"ImageBoundForwarderRefEntry",
"}",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L107-L135 | [
"def",
"parse",
"(",
"readDataInstance",
",",
"numberOfEntries",
")",
":",
"imageBoundForwarderRefsList",
"=",
"ImageBoundForwarderRef",
"(",
")",
"dLength",
"=",
"len",
"(",
"readDataInstance",
")",
"entryLength",
"=",
"ImageBoundForwarderRefEntry",
"(",
")",
".",
... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
train | ImageBoundImportDescriptor.parse | Returns a new L{ImageBoundImportDescriptor} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object containing the data to create a new L{ImageBoundImportDescriptor} object.
@rtype: L{ImageBoundImportDescriptor}
@return: A new {ImageBou... | pype32/directories.py | def parse(readDataInstance):
"""
Returns a new L{ImageBoundImportDescriptor} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object containing the data to create a new L{ImageBoundImportDescriptor} object.
@rtype: L{ImageBoundI... | def parse(readDataInstance):
"""
Returns a new L{ImageBoundImportDescriptor} object.
@type readDataInstance: L{ReadData}
@param readDataInstance: A L{ReadData} object containing the data to create a new L{ImageBoundImportDescriptor} object.
@rtype: L{ImageBoundI... | [
"Returns",
"a",
"new",
"L",
"{",
"ImageBoundImportDescriptor",
"}",
"object",
"."
] | crackinglandia/pype32 | python | https://github.com/crackinglandia/pype32/blob/192fd14dfc0dd36d953739a81c17fbaf5e3d6076/pype32/directories.py#L153-L182 | [
"def",
"parse",
"(",
"readDataInstance",
")",
":",
"ibd",
"=",
"ImageBoundImportDescriptor",
"(",
")",
"entryData",
"=",
"readDataInstance",
".",
"read",
"(",
"consts",
".",
"SIZEOF_IMAGE_BOUND_IMPORT_ENTRY32",
")",
"readDataInstance",
".",
"offset",
"=",
"0",
"wh... | 192fd14dfc0dd36d953739a81c17fbaf5e3d6076 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.